]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test for -wc
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 10 May 2020 14:19:38 +0000 (07:19 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 10 May 2020 14:19:38 +0000 (07:19 -0700)
t/snippets/expect/wc.def [new file with mode: 0644]
t/snippets/expect/wc.wc1 [new file with mode: 0644]
t/snippets/expect/wc.wc2 [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/wc.in [new file with mode: 0644]
t/snippets/wc1.par [new file with mode: 0644]
t/snippets/wc2.par [new file with mode: 0644]
t/snippets20.t

diff --git a/t/snippets/expect/wc.def b/t/snippets/expect/wc.def
new file mode 100644 (file)
index 0000000..107dfbb
--- /dev/null
@@ -0,0 +1,22 @@
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    {
+        {
+            {
+                {
+                    if ( !$array[0] ) {
+                        $array[0] =
+                          &$CantProcessPartFunc(
+                            $entity->{'fields'}{'content-type'} );
+                    }
+
+                }
+            }
+        }
+    }
+}
+
diff --git a/t/snippets/expect/wc.wc1 b/t/snippets/expect/wc.wc1
new file mode 100644 (file)
index 0000000..c29a58a
--- /dev/null
@@ -0,0 +1,21 @@
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    {
+        {
+            {
+                {
+    if ( !$array[0] ) {
+        $array[0] =
+          &$CantProcessPartFunc( $entity->{'fields'}{'content-type'} );
+    }
+
+                }
+            }
+        }
+    }
+}
+
diff --git a/t/snippets/expect/wc.wc2 b/t/snippets/expect/wc.wc2
new file mode 100644 (file)
index 0000000..c1b7c28
--- /dev/null
@@ -0,0 +1,15 @@
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    { { { {
+        if ( !$array[0] ) {
+            $array[0] =
+              &$CantProcessPartFunc( $entity->{'fields'}{'content-type'} );
+        }
+
+    } } } }
+}
+
index 7a99d59ca9366ad3d35b5149490e74cd29069353..9ecdd1a1aa876c40109c5c71b48e308dac816452 100644 (file)
 ../snippets2.t ce1.def
 ../snippets20.t        space6.def
 ../snippets20.t        space6.space6
+../snippets20.t        sub3.def
 ../snippets3.t ce_wn1.ce_wn
 ../snippets3.t ce_wn1.def
 ../snippets3.t colin.colin
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
+../snippets20.t        wc.def
+../snippets20.t        wc.wc1
+../snippets20.t        wc.wc2
diff --git a/t/snippets/wc.in b/t/snippets/wc.in
new file mode 100644 (file)
index 0000000..4504b22
--- /dev/null
@@ -0,0 +1,15 @@
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+    } (0 .. $#cells);
+
+{{{{
+                    if ( !$array[0] ) {
+                        $array[0] =
+                          &$CantProcessPartFunc( $entity->{'fields'}{
+                          'content-type'} );
+                    }
+                    
+}}}}}
+
diff --git a/t/snippets/wc1.par b/t/snippets/wc1.par
new file mode 100644 (file)
index 0000000..2f5c692
--- /dev/null
@@ -0,0 +1 @@
+-wc=4
diff --git a/t/snippets/wc2.par b/t/snippets/wc2.par
new file mode 100644 (file)
index 0000000..b99db02
--- /dev/null
@@ -0,0 +1 @@
+-wc=4 -wn
index 0f7486c50896d7509ab358d5cf7d219c67545faa..5f41b56a372d39820c69d3a00c1ae1c038f759f2 100644 (file)
@@ -4,6 +4,9 @@
 #1 space6.def
 #2 space6.space6
 #3 sub3.def
+#4 wc.def
+#5 wc.wc1
+#6 wc.wc2
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -26,6 +29,8 @@ BEGIN {
 -nwrs="+ - / *"
 -nwls="+ - / *"
 ----------
+        'wc1' => "-wc=4",
+        'wc2' => "-wc=4 -wn",
     };
 
     ############################
@@ -50,6 +55,24 @@ my $aa = sub
 
 my $bb = sub    #
 { n_stmtexp $_[1] };
+----------
+
+        'wc' => <<'----------',
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+    } (0 .. $#cells);
+
+{{{{
+                    if ( !$array[0] ) {
+                        $array[0] =
+                          &$CantProcessPartFunc( $entity->{'fields'}{
+                          'content-type'} );
+                    }
+                    
+}}}}}
+
 ----------
     };
 
@@ -96,6 +119,85 @@ my $bb = sub    #
 { n_stmtexp $_[1] };
 #3...........
         },
+
+        'wc.def' => {
+            source => "wc",
+            params => "def",
+            expect => <<'#4...........',
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    {
+        {
+            {
+                {
+                    if ( !$array[0] ) {
+                        $array[0] =
+                          &$CantProcessPartFunc(
+                            $entity->{'fields'}{'content-type'} );
+                    }
+
+                }
+            }
+        }
+    }
+}
+
+#4...........
+        },
+
+        'wc.wc1' => {
+            source => "wc",
+            params => "wc1",
+            expect => <<'#5...........',
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    {
+        {
+            {
+                {
+    if ( !$array[0] ) {
+        $array[0] =
+          &$CantProcessPartFunc( $entity->{'fields'}{'content-type'} );
+    }
+
+                }
+            }
+        }
+    }
+}
+
+#5...........
+        },
+
+        'wc.wc2' => {
+            source => "wc",
+            params => "wc2",
+            expect => <<'#6...........',
+{
+    my (@indices) =
+      sort {
+        $dir eq 'left' ? $cells[$a] <=> $cells[$b] : $cells[$b] <=> $cells[$a];
+      } ( 0 .. $#cells );
+
+    { { { {
+        if ( !$array[0] ) {
+            $array[0] =
+              &$CantProcessPartFunc( $entity->{'fields'}{'content-type'} );
+        }
+
+    } } } }
+}
+
+#6...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};