33use strict;
44use warnings;
55
6- use Test::More tests => 196 ;
6+ use Test::More tests => 178 ;
77use lib ' t' ;
88use Util;
99
@@ -13,20 +13,6 @@ my $file = 't/text/raven.txt';
1313my $word = ' nevermore' ;
1414
1515
16- # Order doesn't matter. They are reported in alphabetical order.
17- for my $opt ( qw( -p --proximate ) ) {
18- are_mutually_exclusive( ' -f' , $opt , [' -f' , $opt ] );
19- are_mutually_exclusive( ' -f' , $opt , [$opt , ' -f' ] );
20- }
21-
22- # Check for abbreviations. https://github.com/beyondgrep/ack3/issues/57
23- for my $opt ( qw( --pro --prox --proxima --proximat --proximate ) ) {
24- are_mutually_exclusive( ' -f' , ' --proximate' ,
25- [' -f' , $opt , ' 4' ],
26- [' -f' , " $opt =4" ],
27- );
28- }
29-
3016# XXX Should also handle --files-with-matches and --files-without-matches. See https://github.com/beyondgrep/ack3/issues/57
3117are_mutually_exclusive(' -l' , ' -L' , [' -l' , ' -L' , $word , $file ]);
3218for my $opt ( qw( -l -L ) ) {
@@ -115,14 +101,6 @@ are_mutually_exclusive('--output', '--after-context', ['--output=$&', '--after-c
115101are_mutually_exclusive(' --output' , ' --before-context' , [' --output=$&' , ' --before-context=2' , $word , $file ]);
116102are_mutually_exclusive(' --output' , ' --context' , [' --output=$&' , ' --context=2' , $word , $file ]);
117103
118- # --match
119- for my $opt ( qw( -f -g ) ) {
120- are_mutually_exclusive(' --match' , $opt ,
121- [' --match' , $word , $opt , $file ],
122- [' --match=science' , $opt , $file ],
123- );
124- }
125-
126104# --max-count
127105for my $opt ( qw( -1 -c -f -g ) ) {
128106 are_mutually_exclusive( ' -m' , $opt , [' -m' , 1, $opt , $word , $file ] );
@@ -182,6 +160,7 @@ for my $opt ( qw( -f -g ) ) {
182160 are_mutually_exclusive( $opt , ' --files-from' , [$opt , ' --files-from' , $word , $file ] );
183161}
184162
163+
185164subtest q{ Verify that "options" that follow -- aren't factored into the mutual exclusivity} => sub {
186165 my ( $stdout , $stderr ) = run_ack_with_stderr(' -A' , 5, $word , $file , ' --' , ' -l' );
187166 ok(@{$stdout } > 0, ' Some lines should appear on standard output' );
0 commit comments