Skip to content

Commit 44aef5c

Browse files
committed
Add test for issue #491
1 parent 30e8d77 commit 44aef5c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

t/issue491.t

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!perl -T
2+
3+
use strict;
4+
use warnings;
5+
use lib 't';
6+
7+
use Test::More tests => 4;
8+
use File::Temp;
9+
use Util;
10+
11+
prep_environment();
12+
13+
my $dir = File::Temp->newdir;
14+
my $wd = getcwd_clean();
15+
chdir $dir->dirname;
16+
write_file('space-newline.txt', " \n");
17+
write_file('space-newline-newline.txt', " \n\n");
18+
19+
my @results = run_ack('-l', ' $', 'space-newline.txt', 'space-newline-newline.txt');
20+
21+
sets_match(\@results, [
22+
'space-newline.txt',
23+
'space-newline-newline.txt',
24+
], 'both files should be in -l output');
25+
26+
@results = run_ack('-c', ' $', 'space-newline.txt', 'space-newline-newline.txt');
27+
28+
sets_match(\@results, [
29+
'space-newline.txt:1',
30+
'space-newline-newline.txt:1',
31+
], 'both files should be in -c output with correct counts');
32+
33+
chdir $wd;

0 commit comments

Comments
 (0)