-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathack-no-lineno.t
More file actions
101 lines (71 loc) · 2.7 KB
/
Copy pathack-no-lineno.t
File metadata and controls
101 lines (71 loc) · 2.7 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!perl
use strict;
use warnings;
use Test::More tests => 8;
use lib 't';
use Util;
prep_environment();
INTERACTIVE_MULTIPLE_FILES: {
my @args = qw( --no-lineno --no-color strict );
my @files = qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file
use strict;
HERE
my @results = run_ack_interactive( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict interactively in multiple files' );
}
INTERACTIVE_MULTIPLE_FILES_NO_HEADING: {
my @args = qw( --no-lineno --no-heading --no-color strict );
my @files = qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file:use strict;
HERE
my @results = run_ack_interactive( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict interactively in multiple files with --no-heading' );
}
INTERACTIVE_ONE_FILE: {
my @args = ( qw( --no-lineno --with-filename --no-color strict ) );
my @files = qw( t/swamp/options.pl );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file
use strict;
HERE
my @results = run_ack_interactive( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict interactively in one file with filename' );
}
INTERACTIVE_ONE_FILE_NO_HEADING: {
my @args = ( qw( --no-lineno --with-filename --no-heading --no-color strict ) );
my @files = qw( t/swamp/options.pl );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file:use strict;
HERE
my @results = run_ack_interactive( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict interactively in one file with filename and --no-heading' );
}
NON_INTERACTIVE_MULTIPLE_FILES: {
my @args = qw( --no-lineno strict );
my @files = qw( t/swamp/options.pl t/swamp/pipe-stress-freaks.F );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file:use strict;
HERE
my @results = run_ack( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict in multiple files' );
}
NON_INTERACTIVE_ONE_FILE: {
my @args = ( qw( --no-lineno --with-filename strict ) );
my @files = qw( t/swamp/options.pl );
my $target_file = reslash( 't/swamp/options.pl' );
my @expected = line_split( <<"HERE" );
$target_file:use strict;
HERE
my @results = run_ack( @args, @files );
lists_match( \@results, \@expected, 'Looking for strict in one file with filename' );
}
done_testing();
exit 0;