From 86b23c14fa1cd33159a3af536c52664acd5e6ed0 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 30 Nov 2018 18:09:24 -0800 Subject: [PATCH] added alignment test case --- t/snippets/expect/ternary3.def | 8 ++++++++ t/snippets/packing_list.txt | 13 +++++++------ t/snippets/ternary3.in | 7 +++++++ t/snippets14.t | 26 ++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 t/snippets/expect/ternary3.def create mode 100644 t/snippets/ternary3.in diff --git a/t/snippets/expect/ternary3.def b/t/snippets/expect/ternary3.def new file mode 100644 index 00000000..cb14f900 --- /dev/null +++ b/t/snippets/expect/ternary3.def @@ -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; + diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index 6a0c1e33..8cd359b5 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -94,6 +94,12 @@ ../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 @@ -254,9 +260,4 @@ ../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 index 00000000..eab857f0 --- /dev/null +++ b/t/snippets/ternary3.in @@ -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; + diff --git a/t/snippets14.t b/t/snippets14.t index 013585ee..38ac5b59 100644 --- a/t/snippets14.t +++ b/t/snippets14.t @@ -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}; -- 2.39.5