From: Steve Hancock Date: Wed, 24 Nov 2021 01:19:43 +0000 (-0800) Subject: added test for issue git #74 X-Git-Tag: 20211029.02~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c769c6647ddf12d9acc2c9662c3d9ea8236e2022;p=perltidy.git added test for issue git #74 --- diff --git a/t/snippets/expect/git74.def b/t/snippets/expect/git74.def new file mode 100644 index 00000000..73d65928 --- /dev/null +++ b/t/snippets/expect/git74.def @@ -0,0 +1,9 @@ +$self->func( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub { + my ($res) = @_; + print($res); + } + } +); diff --git a/t/snippets/expect/git74.git74 b/t/snippets/expect/git74.git74 new file mode 100644 index 00000000..40cb4518 --- /dev/null +++ b/t/snippets/expect/git74.git74 @@ -0,0 +1,10 @@ +$self -> func ( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub + { + my ($res) = @_ ; + print ($res) ; + } + } + ) ; diff --git a/t/snippets/git74.in b/t/snippets/git74.in new file mode 100644 index 00000000..a6e2a511 --- /dev/null +++ b/t/snippets/git74.in @@ -0,0 +1,9 @@ +$self->func( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub { + my ($res) = @_; + print($res); + } + } +); diff --git a/t/snippets/git74.par b/t/snippets/git74.par new file mode 100644 index 00000000..f82c4544 --- /dev/null +++ b/t/snippets/git74.par @@ -0,0 +1,17 @@ +-xlp +--iterations=2 +--maximum-line-length=120 +--line-up-parentheses +--continuation-indentation=4 +--closing-token-indentation=1 +--want-left-space="= -> ( )" +--want-right-space="= -> ( )" +--space-function-paren +--space-keyword-paren +--space-terminal-semicolon +--opening-brace-on-new-line +--opening-sub-brace-on-new-line +--opening-anonymous-sub-brace-on-new-line +--brace-left-and-indent +--brace-left-and-indent-list="*" +--break-before-hash-brace=3 diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index a042024b..086f629e 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -336,6 +336,8 @@ ../snippets25.t braces.braces8 ../snippets25.t rt140025.def ../snippets25.t rt140025.rt140025 +../snippets25.t xlp1.def +../snippets25.t xlp1.xlp1 ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -476,5 +478,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets25.t xlp1.def -../snippets25.t xlp1.xlp1 +../snippets25.t git74.def +../snippets25.t git74.git74 diff --git a/t/snippets25.t b/t/snippets25.t index 71e782c4..0c848d01 100644 --- a/t/snippets25.t +++ b/t/snippets25.t @@ -12,6 +12,8 @@ #9 rt140025.rt140025 #10 xlp1.def #11 xlp1.xlp1 +#12 git74.def +#13 git74.git74 # To locate test #13 you can search for its name or the string '#13' @@ -32,7 +34,26 @@ BEGIN { 'braces8' => <<'----------', -bl -bbvt=1 -blxl=' ' -bll='sub do asub' ---------- - 'def' => "", + 'def' => "", + 'git74' => <<'----------', +-xlp +--iterations=2 +--maximum-line-length=120 +--line-up-parentheses +--continuation-indentation=4 +--closing-token-indentation=1 +--want-left-space="= -> ( )" +--want-right-space="= -> ( )" +--space-function-paren +--space-keyword-paren +--space-terminal-semicolon +--opening-brace-on-new-line +--opening-sub-brace-on-new-line +--opening-anonymous-sub-brace-on-new-line +--brace-left-and-indent +--brace-left-and-indent-list="*" +--break-before-hash-brace=3 +---------- 'lp' => "-lp", 'novalign1' => "-novalign", 'novalign2' => "-nvsc -nvbc -msc=2", @@ -95,6 +116,18 @@ try { catch { die; }; +---------- + + 'git74' => <<'----------', +$self->func( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub { + my ($res) = @_; + print($res); + } + } +); ---------- 'lp2' => <<'----------', @@ -437,6 +470,39 @@ $cb1 = $act_page->Checkbutton( ); #11........... }, + + 'git74.def' => { + source => "git74", + params => "def", + expect => <<'#12...........', +$self->func( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub { + my ($res) = @_; + print($res); + } + } +); +#12........... + }, + + 'git74.git74' => { + source => "git74", + params => "git74", + expect => <<'#13...........', +$self -> func ( + { + command => [ 'command', 'argument1', 'argument2' ], + callback => sub + { + my ($res) = @_ ; + print ($res) ; + } + } + ) ; +#13........... + }, }; my $ntests = 0 + keys %{$rtests};