From: Steve Hancock Date: Sat, 9 May 2020 12:50:20 +0000 (-0700) Subject: added test case X-Git-Tag: 20200619~41 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7d872ccf22c1e951da3747a5c30a83136d31e5ee;p=perltidy.git added test case --- diff --git a/t/snippets/expect/sub3.def b/t/snippets/expect/sub3.def new file mode 100644 index 00000000..53f569d0 --- /dev/null +++ b/t/snippets/expect/sub3.def @@ -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 index 00000000..53f569d0 --- /dev/null +++ b/t/snippets/sub3.in @@ -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/snippets20.t b/t/snippets20.t index b1070e62..0f7486c5 100644 --- a/t/snippets20.t +++ b/t/snippets20.t @@ -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};