]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test for -ce with -cbl=map,sort,grep
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 4 Jun 2019 00:40:40 +0000 (17:40 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 4 Jun 2019 00:40:40 +0000 (17:40 -0700)
t/snippets/expect/git09.def [new file with mode: 0644]
t/snippets/expect/git09.git09 [new file with mode: 0644]
t/snippets/git09.in [new file with mode: 0644]
t/snippets/git09.par [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets15.t

diff --git a/t/snippets/expect/git09.def b/t/snippets/expect/git09.def
new file mode 100644 (file)
index 0000000..8d85549
--- /dev/null
@@ -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 (file)
index 0000000..12813d7
--- /dev/null
@@ -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 (file)
index 0000000..437dd98
--- /dev/null
@@ -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 (file)
index 0000000..9a8c109
--- /dev/null
@@ -0,0 +1 @@
+-ce -cbl=map,sort,grep
index a4ded4f3d32714e207fb565d101411d464e6b684..6e335f70c17b02225f78f81dab3a86d40abd83fe 100644 (file)
 ../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
 ../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
index 1d474ed756d621859a757ff11d225c042c34b59c..388213e2c658ea88fbb85bc15d63ee84c32763df 100644 (file)
@@ -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};