]> git.donarmstrong.com Git - perltidy.git/commitdiff
Added test case for !~ and patched script make_t.pl
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 13 Nov 2018 02:07:51 +0000 (18:07 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 13 Nov 2018 02:07:51 +0000 (18:07 -0800)
t/snippets/align13.in [new file with mode: 0644]
t/snippets/expect/align13.def [new file with mode: 0644]
t/snippets/make_t.pl
t/snippets/packing_list.txt
t/snippets13.t

diff --git a/t/snippets/align13.in b/t/snippets/align13.in
new file mode 100644 (file)
index 0000000..48ffd0e
--- /dev/null
@@ -0,0 +1,5 @@
+# symbols =~ and !~ are equivalent in alignment
+ok( $out !~ /EXACT <fop>/, "No 'baz'" );
+ok( $out =~ /<liz>/,       "Got 'liz'" );    # liz
+ok( $out =~ /<zoo>/,       "Got 'zoo'" );    # zoo
+ok( $out !~ /<zap>/,       "Got 'zap'" );    # zap 
diff --git a/t/snippets/expect/align13.def b/t/snippets/expect/align13.def
new file mode 100644 (file)
index 0000000..d647a96
--- /dev/null
@@ -0,0 +1,5 @@
+# symbols =~ and !~ are equivalent in alignment
+ok( $out !~ /EXACT <fop>/, "No 'baz'" );
+ok( $out =~ /<liz>/,       "Got 'liz'" );    # liz
+ok( $out =~ /<zoo>/,       "Got 'zoo'" );    # zoo
+ok( $out !~ /<zap>/,       "Got 'zap'" );    # zap
index 0cab9d8ca3b91d59510ce1845f266179cd3799a7..56d6558735c5139f153362c8e37bf9d335bda435 100755 (executable)
@@ -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;
index 5e7b71dbd9e7cd310f367797d5486ced11440951..c7734126a7d3faae066ac8eea6ece6b16cd0273d 100644 (file)
@@ -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
 ../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
index 69981681a7315a49bff86160813cf69d7ed538f2..51e8c9cfea0578a366909b0eb09de15eb1e053c6 100644 (file)
@@ -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 <fop>/, "No 'baz'" );
+ok( $out =~ /<liz>/,       "Got 'liz'" );    # liz
+ok( $out =~ /<zoo>/,       "Got 'zoo'" );    # zoo
+ok( $out !~ /<zap>/,       "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 <fop>/, "No 'baz'" );
+ok( $out =~ /<liz>/,       "Got 'liz'" );    # liz
+ok( $out =~ /<zoo>/,       "Got 'zoo'" );    # zoo
+ok( $out !~ /<zap>/,       "Got 'zap'" );    # zap
+#4...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};