From 6660f33d1cbbf207e582c0af97d083c2fcf0ca01 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 3 Jun 2019 17:40:40 -0700 Subject: [PATCH] added test for -ce with -cbl=map,sort,grep --- t/snippets/expect/git09.def | 5 +++++ t/snippets/expect/git09.git09 | 8 +++++++ t/snippets/git09.in | 8 +++++++ t/snippets/git09.par | 1 + t/snippets/packing_list.txt | 6 +++-- t/snippets15.t | 41 +++++++++++++++++++++++++++++++++++ 6 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 t/snippets/expect/git09.def create mode 100644 t/snippets/expect/git09.git09 create mode 100644 t/snippets/git09.in create mode 100644 t/snippets/git09.par diff --git a/t/snippets/expect/git09.def b/t/snippets/expect/git09.def new file mode 100644 index 00000000..8d85549a --- /dev/null +++ b/t/snippets/expect/git09.def @@ -0,0 +1,5 @@ +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = + map { $_->[0] } + sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } + map { [ $_, length($_) ] } @unsorted; diff --git a/t/snippets/expect/git09.git09 b/t/snippets/expect/git09.git09 new file mode 100644 index 00000000..12813d7b --- /dev/null +++ b/t/snippets/expect/git09.git09 @@ -0,0 +1,8 @@ +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = map { + $_->[0] +} sort { + $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] +} map { + [ $_, length($_) ] +} @unsorted; diff --git a/t/snippets/git09.in b/t/snippets/git09.in new file mode 100644 index 00000000..437dd989 --- /dev/null +++ b/t/snippets/git09.in @@ -0,0 +1,8 @@ +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = map { + $_->[0] +} sort { + $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] +} map { + [$_, length($_)] +} @unsorted; diff --git a/t/snippets/git09.par b/t/snippets/git09.par new file mode 100644 index 00000000..9a8c1098 --- /dev/null +++ b/t/snippets/git09.par @@ -0,0 +1 @@ +-ce -cbl=map,sort,grep diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index a4ded4f3..6e335f70 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -127,6 +127,8 @@ ../snippets15.t bom1.bom ../snippets15.t bom1.def ../snippets15.t align28.def +../snippets15.t align29.def +../snippets15.t align30.def ../snippets2.t angle.def ../snippets2.t arrows1.def ../snippets2.t arrows2.def @@ -287,5 +289,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets15.t align29.def -../snippets15.t align30.def +../snippets15.t git09.def +../snippets15.t git09.git09 diff --git a/t/snippets15.t b/t/snippets15.t index 1d474ed7..388213e2 100644 --- a/t/snippets15.t +++ b/t/snippets15.t @@ -13,6 +13,8 @@ #10 align28.def #11 align29.def #12 align30.def +#13 git09.def +#14 git09.git09 # To locate test #13 you can search for its name or the string '#13' @@ -33,6 +35,7 @@ BEGIN { 'bom' => "-bom -wn", 'break_old_methods' => "--break-at-old-method-breakpoints", 'def' => "", + 'git09' => "-ce -cbl=map,sort,grep", 'gnu' => "-gnu", 'olbs0' => "-olbs=0", 'olbs2' => "-olbs=2", @@ -96,6 +99,17 @@ my $q = $rs ->as_query; ---------- + 'git09' => <<'----------', +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = map { + $_->[0] +} sort { + $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] +} map { + [$_, length($_)] +} @unsorted; +---------- + 'gnu5' => <<'----------', # side comments limit gnu type formatting with l=80; note extra comma push @tests, [ @@ -322,6 +336,33 @@ is( log10(1), 0, "Basic log10(1) test" ); ( $rho_c, $theta, $z ) = spherical_to_cylindrical( $rho_s, $theta, $phi ); #12........... }, + + 'git09.def' => { + source => "git09", + params => "def", + expect => <<'#13...........', +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = + map { $_->[0] } + sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } + map { [ $_, length($_) ] } @unsorted; +#13........... + }, + + 'git09.git09' => { + source => "git09", + params => "git09", + expect => <<'#14...........', +# no one-line block for first map with -ce -cbl=map,sort,grep +@sorted = map { + $_->[0] +} sort { + $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] +} map { + [ $_, length($_) ] +} @unsorted; +#14........... + }, }; my $ntests = 0 + keys %{$rtests}; -- 2.39.5