File tree Expand file tree Collapse file tree 4 files changed +16
-23
lines changed
Expand file tree Collapse file tree 4 files changed +16
-23
lines changed Original file line number Diff line number Diff line change @@ -875,24 +875,21 @@ sub build_all_regexes {
875875 $re_hilite = $re_match ;
876876 $re_scan = join ( ' |' , @scan_parts );
877877 }
878-
879- # NOT: alpha NOT beta
880- if ( @parts = @{$opt -> {not }} ) {
878+ else {
881879 ($re_match , $re_scan ) = build_regex( $opt_regex , $opt );
882880 $re_hilite = $re_match ;
881+ }
883882
883+ # The --not does not affect the main regex. It is checked separately.
884+ # NOT: alpha NOT beta
885+ if ( @parts = @{$opt -> {not }} ) {
884886 my @not_parts ;
885887 for my $part ( @parts ) {
886888 (my $re , undef ) = build_regex( $part , $opt );
887889 push @not_parts , $re ;
888890 }
889891 $re_not = join ( ' |' , @not_parts );
890892 }
891- # No booleans.
892- else {
893- ($re_match , $re_scan ) = build_regex( $opt_regex , $opt );
894- $re_hilite = $re_match ;
895- }
896893
897894 return ($re_match , $re_not , $re_hilite , $re_scan );
898895}
Original file line number Diff line number Diff line change @@ -123,23 +123,28 @@ stdout: |
123123 ---
124124name : -g and --and
125125args : -g foo --and test t/
126- stdout :
126+ stdout : |
127127 t/swamp/foo_test.py
128128 t/swamp/test_foo.py
129129
130130 ---
131131name : -g and --not
132132args : -g foo --not test t/
133- stdout :
133+ stdout : |
134134 t/etc/shebang.foobar.xxx
135135 t/swamp/file.foo
136136
137137 ---
138138name : -g and --or
139- args : -g foo --or test t/
140- stdout :
139+ args : -g foo --or ample t/
140+ stdout : |
141141 t/etc/shebang.foobar.xxx
142- t/swamp/file.bar
142+ t/swamp/example.R
143143 t/swamp/file.foo
144144 t/swamp/foo_test.py
145+ t/swamp/Sample.ascx
146+ t/swamp/Sample.asmx
147+ t/swamp/sample.asp
148+ t/swamp/sample.aspx
149+ t/swamp/sample.rake
145150 t/swamp/test_foo.py
Original file line number Diff line number Diff line change @@ -71,12 +71,3 @@ exitcode: 255
7171stdout :
7272stderr : |
7373 ack: Options '--and' and '--or' can't be used together.
74-
75- ---
76- name : --or and --not
77- args :
78- - this --or that --not other
79- exitcode : 255
80- stdout :
81- stderr : |
82- ack: Options '--not' and '--or' can't be used together.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ MAIN: {
3434 if ( $tempfilename ) {
3535 $args = [ @{$args }, $tempfilename ];
3636 }
37- subtest $test -> {name } . ' ' . join ( ' , ' , @{$args } ) => sub {
37+ subtest $test -> {name } . ' : ack ' . join ( ' ' , @{$args } ) => sub {
3838 if ( exists $test -> {stderr } ) {
3939 ack_stderr_matches( $args , $test -> {stderr }, $test -> {name } );
4040 is( get_rc(), $test -> {exitcode }, ' Exit code matches' );
You can’t perform that action at this time.
0 commit comments