File tree 6 files changed +141
-182
lines changed
6 files changed +141
-182
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ t/ack-group.t
47
47
t/ack-h.yaml
48
48
t/ack-help-types.t
49
49
t/ack-help.t
50
- t/ack-i.barfly
51
- t/ack-i.t
50
+ t/ack-i.yaml
52
51
t/ack-ignore-dir.t
53
52
t/ack-ignore-file.t
54
53
t/ack-k.yaml
Original file line number Diff line number Diff line change @@ -1341,6 +1341,7 @@ sub _validate_test {
1341
1341
indent-stdout
1342
1342
name
1343
1343
ordered
1344
+ stdin
1344
1345
stderr
1345
1346
stdout
1346
1347
) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Straight -i
3
+ args :
4
+ - APPLE t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat -i
5
+ - APPLE t/swamp/groceries/fruit t/swamp/groceries/junk t/swamp/groceries/meat --ignore-case
6
+ ordered : true
7
+ stdout : |
8
+ t/swamp/groceries/fruit:1:apple
9
+ t/swamp/groceries/junk:1:apple fritters
10
+
11
+ ---
12
+ name : No -i or -I
13
+ args :
14
+ - foo
15
+ - foo -I
16
+ - foo --no-smart-case
17
+ ordered : true
18
+ stdin : |
19
+ Football
20
+ foo bar
21
+ foOtball
22
+ bluhblah
23
+ football
24
+ stdout : |
25
+ foo bar
26
+ football
27
+
28
+ ---
29
+ name : Normal -i
30
+ args :
31
+ - foo -i
32
+ - foo --ignore-case
33
+ - Foo -i
34
+ - Foo --ignore-case
35
+ ordered : true
36
+ stdin : |
37
+ Football
38
+ foo bar
39
+ pickles
40
+ foOtball
41
+ bluhblah
42
+ football
43
+ stdout : |
44
+ Football
45
+ foo bar
46
+ foOtball
47
+ football
48
+
49
+ ---
50
+ name : Smartcase invoked
51
+ args :
52
+ - foo --smart-case
53
+ - foo -S
54
+ ordered : true
55
+ stdin : |
56
+ football
57
+ foo bar
58
+ Football
59
+ foOtball
60
+ stdout : |
61
+ football
62
+ foo bar
63
+ Football
64
+ foOtball
65
+
66
+ ---
67
+ name : Smartcase invoked because of the case of the search string
68
+ args :
69
+ - Foo --smart-case
70
+ - Foo -S
71
+ ordered : true
72
+ stdin : |
73
+ football
74
+ foo bar
75
+ Football
76
+ foOtball
77
+ stdout : |
78
+ Football
79
+
80
+ ---
81
+ name : -i overrides --smart-case
82
+ args :
83
+ - Foo --smart-case -i
84
+ - foo --smart-case -i
85
+ - Foo -S -i
86
+ - foo -S -i
87
+ ordered : true
88
+ stdin : |
89
+ football
90
+ foo bar
91
+ Football
92
+ foOtball
93
+ stdout : |
94
+ football
95
+ foo bar
96
+ Football
97
+ foOtball
98
+
99
+ ---
100
+ name : -I overrides -i
101
+ args :
102
+ - Foo -i -I
103
+ - Foo --ignore-case -I
104
+ ordered : true
105
+ stdin : |
106
+ Football
107
+ football
108
+ foo bar
109
+ foOtball
110
+ stdout : |
111
+ Football
112
+
113
+ ---
114
+ name : -I overrides --smart-case
115
+ args :
116
+ - Foo --smart-case -I
117
+ - Foo -S -I
118
+ ordered : true
119
+ stdin : |
120
+ Football
121
+ football
122
+ foo bar
123
+ foOtball
124
+ stdout : |
125
+ Football
Original file line number Diff line number Diff line change 3
3
use warnings;
4
4
use strict;
5
5
6
- use Test::More tests => 15 ;
6
+ use Test::More tests => 16 ;
7
7
8
8
use lib ' t' ;
9
9
use Util;
@@ -18,7 +18,17 @@ MAIN: {
18
18
my @tests = read_tests( $file );
19
19
20
20
for my $test ( @tests ) {
21
+ my $tempfilename ;
22
+ if ( my $stdin = $test -> {stdin } ) {
23
+ my $fh = File::Temp-> new( UNLINK => 0 ); # We'll delete it ourselves.
24
+ $tempfilename = $fh -> filename;
25
+ print {$fh } $stdin ;
26
+ close $fh ;
27
+ }
21
28
for my $args ( @{$test -> {args }} ) {
29
+ if ( $tempfilename ) {
30
+ $args = [ @{$args }, $tempfilename ];
31
+ }
22
32
subtest $test -> {name } . ' ' . join ( ' , ' , @{$args } ) => sub {
23
33
if ( $test -> {ordered } ) {
24
34
ack_lists_match( $args , $test -> {stdout }, $test -> {name } );
@@ -29,6 +39,9 @@ MAIN: {
29
39
is( get_rc(), $test -> {exitcode } );
30
40
}
31
41
}
42
+ if ( $tempfilename ) {
43
+ unlink ( $tempfilename );
44
+ }
32
45
}
33
46
};
34
47
}
You can’t perform that action at this time.
0 commit comments