]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test case
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 9 May 2020 12:50:20 +0000 (05:50 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 9 May 2020 12:50:20 +0000 (05:50 -0700)
t/snippets/expect/sub3.def [new file with mode: 0644]
t/snippets/sub3.in [new file with mode: 0644]
t/snippets20.t

diff --git a/t/snippets/expect/sub3.def b/t/snippets/expect/sub3.def
new file mode 100644 (file)
index 0000000..53f569d
--- /dev/null
@@ -0,0 +1,8 @@
+# keep these one-line blocks intact
+
+my $aa = sub
+#line 245 "Parse.yp"
+{ n_stmtexp $_[1] };
+
+my $bb = sub    #
+{ n_stmtexp $_[1] };
diff --git a/t/snippets/sub3.in b/t/snippets/sub3.in
new file mode 100644 (file)
index 0000000..53f569d
--- /dev/null
@@ -0,0 +1,8 @@
+# keep these one-line blocks intact
+
+my $aa = sub
+#line 245 "Parse.yp"
+{ n_stmtexp $_[1] };
+
+my $bb = sub    #
+{ n_stmtexp $_[1] };
index b1070e62e1ba7fc9041013cc29358b6c1f243106..0f7486c50896d7509ab358d5cf7d219c67545faa 100644 (file)
@@ -3,6 +3,7 @@
 # Contents:
 #1 space6.def
 #2 space6.space6
+#3 sub3.def
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -38,6 +39,17 @@ my $z=$x/$y;     # ok to change spaces around both sides of the /
 print $x / $y;   # do not remove space before or after / here
 print $x/$y;     # do not add a space before the / here
 print $x+$y;     # do not add a space before the + here
+----------
+
+        'sub3' => <<'----------',
+# keep these one-line blocks intact
+
+my $aa = sub
+#line 245 "Parse.yp"
+{ n_stmtexp $_[1] };
+
+my $bb = sub    #
+{ n_stmtexp $_[1] };
 ----------
     };
 
@@ -69,6 +81,21 @@ print $x/$y;      # do not add a space before the / here
 print $x+$y;      # do not add a space before the + here
 #2...........
         },
+
+        'sub3.def' => {
+            source => "sub3",
+            params => "def",
+            expect => <<'#3...........',
+# keep these one-line blocks intact
+
+my $aa = sub
+#line 245 "Parse.yp"
+{ n_stmtexp $_[1] };
+
+my $bb = sub    #
+{ n_stmtexp $_[1] };
+#3...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};