File: issue491.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 (33 lines) | stat: -rw-r--r-- 762 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
23
24
25
26
27
28
29
30
31
32
33
#!perl -T

use strict;
use warnings;
use lib 't';

use Test::More tests => 4;
use File::Temp;
use Util;

prep_environment();

my $dir = File::Temp->newdir;
my $wd  = getcwd_clean();
safe_chdir( $dir->dirname );
write_file('space-newline.txt', " \n");
write_file('space-newline-newline.txt', " \n\n");

my @results = run_ack('-l', ' $', 'space-newline.txt', 'space-newline-newline.txt');

sets_match(\@results, [
    'space-newline.txt',
    'space-newline-newline.txt',
], 'both files should be in -l output');

@results = run_ack('-c', ' $', 'space-newline.txt', 'space-newline-newline.txt');

sets_match(\@results, [
    'space-newline.txt:1',
    'space-newline-newline.txt:1',
], 'both files should be in -c output with correct counts');

safe_chdir( $wd );