]> git.donarmstrong.com Git - perltidy.git/commitdiff
add test for -xlp
authorSteve Hancock <perltidy@users.sourceforge.net>
Wed, 24 Nov 2021 01:10:01 +0000 (17:10 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Wed, 24 Nov 2021 01:10:01 +0000 (17:10 -0800)
CHANGES.md
t/snippets/expect/xlp1.def [new file with mode: 0644]
t/snippets/expect/xlp1.xlp1 [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets/xlp1.in [new file with mode: 0644]
t/snippets/xlp1.par [new file with mode: 0644]
t/snippets25.t

index b0d7f90cd2a271721008fd637de16af4fb1a066b..ba1e03580f67ca4d5184c6f7760d3eb0093f742b 100644 (file)
@@ -2,6 +2,14 @@
 
 ## 2021 10 29.01
 
+    - A new flag -xlp has been added which can be set to avoid most of the
+      limitations of the -lp flag regarding side comments, blank lines, and
+      code blocks.  This is off by default to avoid changing existing coding,
+      so this flag has to be set to turn this feature on.  [Documentation still
+      needs to be written].  It will be included in the next release to CPAN,
+      but some details regarding how it handles very long lines may change before
+      the final release to CPAN.  This fixes issues git #64 and git #74.
+
     - The coding for the -lp flag has been rewritten to avoid some problems
       and limitations.  The new coding allows the -lp indentation style to
       mix smoothly with the standard indentation in a single file.  Some problems
diff --git a/t/snippets/expect/xlp1.def b/t/snippets/expect/xlp1.def
new file mode 100644 (file)
index 0000000..bc1362e
--- /dev/null
@@ -0,0 +1,15 @@
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+    -text     => M "Verwenden",
+    -variable => \$qualitaet_s_optimierung,
+    -command  => sub {
+        change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } )
+          ;    # sc
+    },
+)->grid(
+
+    # block comment
+    -row    => $gridy++,
+    -column => 2,
+    -sticky => 'e'
+);
diff --git a/t/snippets/expect/xlp1.xlp1 b/t/snippets/expect/xlp1.xlp1
new file mode 100644 (file)
index 0000000..2939d75
--- /dev/null
@@ -0,0 +1,16 @@
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+                               -text     => M "Verwenden",
+                               -variable => \$qualitaet_s_optimierung,
+                               -command  => sub {
+                                   change_state_all( $act_page1,
+                                                     $qualitaet_s_optimierung,
+                                                     { $cb1 => 1 } );    # sc
+                               },
+)->grid(
+
+          # block comment
+          -row    => $gridy++,
+          -column => 2,
+          -sticky => 'e'
+);
index dba3830e8910211787419204afd74e72d66d7d41..a042024b5f9f9ad79944c43d22ddee7de0eddc71 100644 (file)
 ../snippets25.t        lp2.def
 ../snippets25.t        lp2.lp
 ../snippets25.t        braces.braces8
+../snippets25.t        rt140025.def
+../snippets25.t        rt140025.rt140025
 ../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
-../snippets25.t        rt140025.def
-../snippets25.t        rt140025.rt140025
+../snippets25.t        xlp1.def
+../snippets25.t        xlp1.xlp1
diff --git a/t/snippets/xlp1.in b/t/snippets/xlp1.in
new file mode 100644 (file)
index 0000000..4cde71e
--- /dev/null
@@ -0,0 +1,15 @@
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+  -text     => M "Verwenden",
+  -variable => \$qualitaet_s_optimierung,
+  -command  => sub {
+    change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } )
+      ;    # sc
+  },
+)->grid(
+
+  # block comment
+  -row    => $gridy++,
+  -column => 2,
+  -sticky => 'e'
+);
diff --git a/t/snippets/xlp1.par b/t/snippets/xlp1.par
new file mode 100644 (file)
index 0000000..7e1f66c
--- /dev/null
@@ -0,0 +1 @@
+-xlp
index 79f0a805a4e2fe6d37608200590ca74eb4086e16..71e782c49a8e8ec16a0648245aa842dbae937322 100644 (file)
@@ -10,6 +10,8 @@
 #7 braces.braces8
 #8 rt140025.def
 #9 rt140025.rt140025
+#10 xlp1.def
+#11 xlp1.xlp1
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -36,6 +38,7 @@ BEGIN {
         'novalign2' => "-nvsc -nvbc -msc=2",
         'novalign3' => "-nvc",
         'rt140025'  => "-lp -xci -ci=4 -ce",
+        'xlp1'      => "-xlp",
     };
 
     ############################
@@ -142,6 +145,24 @@ my $cmd;
  }
  }
 };
+----------
+
+        'xlp1' => <<'----------',
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+  -text     => M "Verwenden",
+  -variable => \$qualitaet_s_optimierung,
+  -command  => sub {
+    change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } )
+      ;    # sc
+  },
+)->grid(
+
+  # block comment
+  -row    => $gridy++,
+  -column => 2,
+  -sticky => 'e'
+);
 ----------
     };
 
@@ -371,6 +392,51 @@ FORK: {
 };
 #9...........
         },
+
+        'xlp1.def' => {
+            source => "xlp1",
+            params => "def",
+            expect => <<'#10...........',
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+    -text     => M "Verwenden",
+    -variable => \$qualitaet_s_optimierung,
+    -command  => sub {
+        change_state_all( $act_page1, $qualitaet_s_optimierung, { $cb1 => 1 } )
+          ;    # sc
+    },
+)->grid(
+
+    # block comment
+    -row    => $gridy++,
+    -column => 2,
+    -sticky => 'e'
+);
+#10...........
+        },
+
+        'xlp1.xlp1' => {
+            source => "xlp1",
+            params => "xlp1",
+            expect => <<'#11...........',
+# test -xlp with comments, broken sub blocks, blank line, line length limit
+$cb1 = $act_page->Checkbutton(
+                               -text     => M "Verwenden",
+                               -variable => \$qualitaet_s_optimierung,
+                               -command  => sub {
+                                   change_state_all( $act_page1,
+                                                     $qualitaet_s_optimierung,
+                                                     { $cb1 => 1 } );    # sc
+                               },
+)->grid(
+
+          # block comment
+          -row    => $gridy++,
+          -column => 2,
+          -sticky => 'e'
+);
+#11...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};