File: issue522.t

package info (click to toggle)
ack 2.24-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,704 kB
  • sloc: perl: 8,590; ansic: 21; fortran: 11; makefile: 5; sh: 5
file content (22 lines) | stat: -rw-r--r-- 511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!perl -T

# https://github.com/beyondgrep/ack2/issues/522

use strict;
use warnings;
use Test::More tests => 4;

use lib 't';
use Util;

prep_environment();

my @stdout;

@stdout = run_ack("use strict;\nuse warnings", 't/swamp');

is scalar(@stdout), 0, 'an embedded newline in the search regex should never match anything';

@stdout = run_ack('-A', '1', "use strict;\nuse warnings", 't/swamp');

is scalar(@stdout), 0, 'an embedded newline in the search regex should never match anything, even with context';