From: Steve Hancock Date: Tue, 13 Nov 2018 02:07:51 +0000 (-0800) Subject: Added test case for !~ and patched script make_t.pl X-Git-Tag: 20181117~15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=141604b127b6fba10708181f5a35683299acdfb0;p=perltidy.git Added test case for !~ and patched script make_t.pl --- diff --git a/t/snippets/align13.in b/t/snippets/align13.in new file mode 100644 index 00000000..48ffd0e6 --- /dev/null +++ b/t/snippets/align13.in @@ -0,0 +1,5 @@ +# symbols =~ and !~ are equivalent in alignment +ok( $out !~ /EXACT /, "No 'baz'" ); +ok( $out =~ //, "Got 'liz'" ); # liz +ok( $out =~ //, "Got 'zoo'" ); # zoo +ok( $out !~ //, "Got 'zap'" ); # zap diff --git a/t/snippets/expect/align13.def b/t/snippets/expect/align13.def new file mode 100644 index 00000000..d647a968 --- /dev/null +++ b/t/snippets/expect/align13.def @@ -0,0 +1,5 @@ +# symbols =~ and !~ are equivalent in alignment +ok( $out !~ /EXACT /, "No 'baz'" ); +ok( $out =~ //, "Got 'liz'" ); # liz +ok( $out =~ //, "Got 'zoo'" ); # zoo +ok( $out !~ //, "Got 'zap'" ); # zap diff --git a/t/snippets/make_t.pl b/t/snippets/make_t.pl index 0cab9d8c..56d65587 100755 --- a/t/snippets/make_t.pl +++ b/t/snippets/make_t.pl @@ -81,7 +81,8 @@ EOM # reading the packing list file. To get it from the file, # pass 'get_passing_list()' the file name. Otherwise, # it will be constructed from the snippets. Both -# methods work. +# methods work. It can be necessary to switch between these +# methods if something goes wrong during development. #my $rpacking_list=get_packing_list($fpacking_list); my $rpacking_list=get_packing_list(); @@ -116,7 +117,7 @@ foreach my $item ( @{$rpacking_list} ) { $rassigned->{$ix} = $ofile; # Find the last snippet file in the set - if ( $ofile =~ /(\d+)\.t/ ) { + if ( $ofile =~ /snippets(\d+)\.t/ ) { my $digits = $1; if ( $digits > $high_digits ) { $high_digits = $digits; @@ -126,7 +127,7 @@ foreach my $item ( @{$rpacking_list} ) { } # Pack all new items. Continue with last file in the list -my $ofile_last = $rpacking_list->[-1]->[0]; +my $ofile_last = $high_file; ##$rpacking_list->[-1]->[0]; my $case_count = $rcount->{$ofile_last} + 1; my $file_count = $high_digits; diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index 5e7b71db..c7734126 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -79,6 +79,9 @@ ../snippets12.t wn5.wn ../snippets12.t wn6.def ../snippets12.t wn6.wn +../snippets13.t align10.def +../snippets13.t align11.def +../snippets13.t align12.def ../snippets2.t angle.def ../snippets2.t arrows1.def ../snippets2.t arrows2.def @@ -239,6 +242,4 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets13.t align10.def -../snippets13.t align11.def -../snippets13.t align12.def +../snippets13.t align13.def diff --git a/t/snippets13.t b/t/snippets13.t index 69981681..51e8c9cf 100644 --- a/t/snippets13.t +++ b/t/snippets13.t @@ -4,6 +4,7 @@ #1 align10.def #2 align11.def #3 align12.def +#4 align13.def # To locate test #13 you can search for its name or the string '#13' @@ -43,6 +44,14 @@ my $account = "Insert into accountlines my $type = shift || "o"; my $fname = ( $type eq 'oo' ? 'orte_city' : 'orte' ); my $suffix = ( $coord_system eq 'standard' ? '' : '-orig' ); +---------- + + 'align13' => <<'----------', +# symbols =~ and !~ are equivalent in alignment +ok( $out !~ /EXACT /, "No 'baz'" ); +ok( $out =~ //, "Got 'liz'" ); # liz +ok( $out =~ //, "Got 'zoo'" ); # zoo +ok( $out !~ //, "Got 'zap'" ); # zap ---------- }; @@ -80,6 +89,18 @@ my $account = "Insert into accountlines my $suffix = ( $coord_system eq 'standard' ? '' : '-orig' ); #3........... }, + + 'align13.def' => { + source => "align13", + params => "def", + expect => <<'#4...........', +# symbols =~ and !~ are equivalent in alignment +ok( $out !~ /EXACT /, "No 'baz'" ); +ok( $out =~ //, "Got 'liz'" ); # liz +ok( $out =~ //, "Got 'zoo'" ); # zoo +ok( $out !~ //, "Got 'zap'" ); # zap +#4........... + }, }; my $ntests = 0 + keys %{$rtests};