]> git.donarmstrong.com Git - perltidy.git/commitdiff
add test cases for -vxl
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 2 Jan 2022 02:31:09 +0000 (18:31 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 2 Jan 2022 02:31:09 +0000 (18:31 -0800)
CHANGES.md
t/snippets/expect/vxl.def [new file with mode: 0644]
t/snippets/expect/vxl.vxl1 [new file with mode: 0644]
t/snippets/expect/vxl.vxl2 [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/vxl.in [new file with mode: 0644]
t/snippets/vxl1.par [new file with mode: 0644]
t/snippets/vxl2.par [new file with mode: 0644]
t/snippets25.t

index e8bc99ca463032dc9382d265075dc69c22c97166..2381365ae5871d0924bda63fc67cff7445b1b558 100644 (file)
@@ -2,6 +2,10 @@
 
 ## 2021 10 29.04
 
+    - Two new flags have been added to provide finer vertical alignment control,
+      --valign-exclusion-list=s (-vxl=s) and  --valign-inclusion-list=s (-vil=s).
+      This has been requested several times, recently in git #79.
+
     - A new flag -gal=s, --grep-alias-list=s, has been added as suggested in
       git #77.  This allows code blocks passed to list operator functions to
       be formatted in the same way as a code block passed to grep, map, or sort.
diff --git a/t/snippets/expect/vxl.def b/t/snippets/expect/vxl.def
new file mode 100644 (file)
index 0000000..27a32ca
--- /dev/null
@@ -0,0 +1,5 @@
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan'  : '';           # description
+$co_prompt      = ($color) ? 'bold green' : '';           # prompt
+$co_unused      = ($color) ? 'on_green'   : 'reverse';    # unused
diff --git a/t/snippets/expect/vxl.vxl1 b/t/snippets/expect/vxl.vxl1
new file mode 100644 (file)
index 0000000..b3b5c8c
--- /dev/null
@@ -0,0 +1,5 @@
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';     # description
+$co_prompt = ($color) ? 'bold green' : '';         # prompt
+$co_unused = ($color) ? 'on_green' : 'reverse';    # unused
diff --git a/t/snippets/expect/vxl.vxl2 b/t/snippets/expect/vxl.vxl2
new file mode 100644 (file)
index 0000000..8eb4aed
--- /dev/null
@@ -0,0 +1,5 @@
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';          # description
+$co_prompt      = ($color) ? 'bold green' : '';         # prompt
+$co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
index 1b67a93163736c051dfb776007eafafaec536fd8..2aa01294364c7c17ac8bd93ee0bd0a6436227185 100644 (file)
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
+../snippets25.t        vxl.def
+../snippets25.t        vxl.vxl1
+../snippets25.t        vxl.vxl2
diff --git a/t/snippets/vxl.in b/t/snippets/vxl.in
new file mode 100644 (file)
index 0000000..8eb4aed
--- /dev/null
@@ -0,0 +1,5 @@
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';          # description
+$co_prompt      = ($color) ? 'bold green' : '';         # prompt
+$co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
diff --git a/t/snippets/vxl1.par b/t/snippets/vxl1.par
new file mode 100644 (file)
index 0000000..ef5305a
--- /dev/null
@@ -0,0 +1 @@
+-vxl='='
diff --git a/t/snippets/vxl2.par b/t/snippets/vxl2.par
new file mode 100644 (file)
index 0000000..c9bbecc
--- /dev/null
@@ -0,0 +1 @@
+-vxl='*' -vil='='
index 2e15c49c70c2a24f216d20385f83a645c391d30c..38ba5de03ddd0eb446f8f3a3567160f18850bbe1 100644 (file)
@@ -16,6 +16,9 @@
 #13 git74.git74
 #14 git77.def
 #15 git77.git77
+#16 vxl.def
+#17 vxl.vxl1
+#18 vxl.vxl2
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -64,7 +67,13 @@ BEGIN {
         'novalign2' => "-nvsc -nvbc -msc=2",
         'novalign3' => "-nvc",
         'rt140025'  => "-lp -xci -ci=4 -ce",
-        'xlp1'      => "-xlp",
+        'vxl1'      => <<'----------',
+-vxl='='
+----------
+        'vxl2' => <<'----------',
+-vxl='*' -vil='='
+----------
+        'xlp1' => "-xlp",
     };
 
     ############################
@@ -249,6 +258,14 @@ my $cmd;
  }
  }
 };
+----------
+
+        'vxl' => <<'----------',
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';          # description
+$co_prompt      = ($color) ? 'bold green' : '';         # prompt
+$co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
 ----------
 
         'xlp1' => <<'----------',
@@ -706,6 +723,42 @@ my $test_var =
     };
 #15...........
         },
+
+        'vxl.def' => {
+            source => "vxl",
+            params => "def",
+            expect => <<'#16...........',
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan'  : '';           # description
+$co_prompt      = ($color) ? 'bold green' : '';           # prompt
+$co_unused      = ($color) ? 'on_green'   : 'reverse';    # unused
+#16...........
+        },
+
+        'vxl.vxl1' => {
+            source => "vxl",
+            params => "vxl1",
+            expect => <<'#17...........',
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';     # description
+$co_prompt = ($color) ? 'bold green' : '';         # prompt
+$co_unused = ($color) ? 'on_green' : 'reverse';    # unused
+#17...........
+        },
+
+        'vxl.vxl2' => {
+            source => "vxl",
+            params => "vxl2",
+            expect => <<'#18...........',
+# if equals is excluded then ternary is automatically excluded
+# side comment alignments always remain
+$co_description = ($color) ? 'bold cyan' : '';          # description
+$co_prompt      = ($color) ? 'bold green' : '';         # prompt
+$co_unused      = ($color) ? 'on_green' : 'reverse';    # unused
+#18...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};