]> git.donarmstrong.com Git - perltidy.git/commitdiff
added alignment test case
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 1 Dec 2018 02:09:24 +0000 (18:09 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 1 Dec 2018 02:09:24 +0000 (18:09 -0800)
t/snippets/expect/ternary3.def [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/ternary3.in [new file with mode: 0644]
t/snippets14.t

diff --git a/t/snippets/expect/ternary3.def b/t/snippets/expect/ternary3.def
new file mode 100644 (file)
index 0000000..cb14f90
--- /dev/null
@@ -0,0 +1,8 @@
+# this previously caused trouble because of the = and =~
+push(
+    @aligns,
+    ( ( $a = shift @a ) =~ /[^n]/ ) ? $a
+    : (@isnum)                      ? 'n'
+    :                                 'l'
+) unless $opt_a;
+
index 6a0c1e331aea4403b459cfaf8e4cb0a3210986a4..8cd359b54b5d4e8b4dc7b972c2df4637b44c954a 100644 (file)
 ../snippets13.t        align21.def
 ../snippets13.t        align22.def
 ../snippets13.t        align23.def
+../snippets13.t        align24.def
+../snippets13.t        align25.def
+../snippets13.t        align26.def
+../snippets13.t        align27.def
+../snippets14.t        else1.def
+../snippets14.t        else2.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        align24.def
-../snippets13.t        align25.def
-../snippets13.t        align26.def
-../snippets13.t        align27.def
-../snippets14.t        else1.def
-../snippets14.t        else2.def
+../snippets14.t        ternary3.def
diff --git a/t/snippets/ternary3.in b/t/snippets/ternary3.in
new file mode 100644 (file)
index 0000000..eab857f
--- /dev/null
@@ -0,0 +1,7 @@
+# this previously caused trouble because of the = and =~
+push( @aligns,
+      ( ( $a = shift @a ) =~ /[^n]/ ) ? $a
+    : (@isnum) ? 'n'
+    :            'l' )
+  unless $opt_a;
+
index 013585ee6efd8709ee9bd37b6a60f6605ba888e0..38ac5b593265c47da9b73c701fb4380cbbadeaff 100644 (file)
@@ -3,6 +3,7 @@
 # Contents:
 #1 else1.def
 #2 else2.def
+#3 ternary3.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -37,6 +38,16 @@ else                                          { $rslt = vmspath($dir); }
        # no pad after 'if' when followed by 'else'
         if ( $m = $g[$x][$y] ) { print $$m{v}; $$m{i}->() }
         else                   { print " " }
+----------
+
+        'ternary3' => <<'----------',
+# this previously caused trouble because of the = and =~
+push( @aligns,
+      ( ( $a = shift @a ) =~ /[^n]/ ) ? $a
+    : (@isnum) ? 'n'
+    :            'l' )
+  unless $opt_a;
+
 ----------
     };
 
@@ -65,6 +76,21 @@ else                                          { $rslt = vmspath($dir); }
         else                   { print " " }
 #2...........
         },
+
+        'ternary3.def' => {
+            source => "ternary3",
+            params => "def",
+            expect => <<'#3...........',
+# this previously caused trouble because of the = and =~
+push(
+    @aligns,
+    ( ( $a = shift @a ) =~ /[^n]/ ) ? $a
+    : (@isnum)                      ? 'n'
+    :                                 'l'
+) unless $opt_a;
+
+#3...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};