From: Steve Hancock Date: Thu, 5 Nov 2020 14:55:07 +0000 (-0800) Subject: add test case for fix git #45 X-Git-Tag: 20201001.03~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9e9d923b54276895a1e6c949abd59e9d6f109281;p=perltidy.git add test case for fix git #45 --- diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index 3dc8b32e..368a9a4e 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -2,6 +2,11 @@ =over 4 +=item B + +When -wn was set, the -vtc=n flag was being ignored. This was a simple fix +made 5 Nov 2020 in 'fix issue git #45, -wn and -vtc=n now work together', 1fbc381. + =item B These parameters request that old breakpoints be kept before or after diff --git a/t/snippets/expect/git45.def b/t/snippets/expect/git45.def new file mode 100644 index 00000000..c8261fe7 --- /dev/null +++ b/t/snippets/expect/git45.def @@ -0,0 +1,22 @@ +# git#45 -vtc=n and -wn were not working together +if ( + $self->_add_fqdn_host( + name => $name, + realm => $realm + ) + ) +{ + ...; +} + +# do not stack )->pack( +my $hlist = $control::control->Scrolled( + 'HList', + drawbranch => 1, + width => 20, + -scrollbars => 'w' +)->pack( + -side => 'bottom', + -expand => 1 +); + diff --git a/t/snippets/expect/git45.git45 b/t/snippets/expect/git45.git45 new file mode 100644 index 00000000..a6ff842f --- /dev/null +++ b/t/snippets/expect/git45.git45 @@ -0,0 +1,18 @@ +# git#45 -vtc=n and -wn were not working together +if ( $self->_add_fqdn_host( + name => $name, + realm => $realm ) ) +{ + ...; +} + +# do not stack )->pack( +my $hlist = $control::control->Scrolled( + 'HList', + drawbranch => 1, + width => 20, + -scrollbars => 'w' +)->pack( + -side => 'bottom', + -expand => 1 ); + diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index e9e5a49e..a662e85a 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -284,6 +284,8 @@ ../snippets22.t mangle4.mangle ../snippets22.t extrude5.def ../snippets22.t extrude5.extrude +../snippets22.t kba1.def +../snippets22.t kba1.kba1 ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -424,5 +426,5 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets22.t kba1.def -../snippets22.t kba1.kba1 +../snippets22.t git45.def +../snippets22.t git45.git45 diff --git a/t/snippets22.t b/t/snippets22.t index 3fa7681c..73414883 100644 --- a/t/snippets22.t +++ b/t/snippets22.t @@ -17,6 +17,8 @@ #14 extrude5.extrude #15 kba1.def #16 kba1.kba1 +#17 git45.def +#18 git45.git45 # To locate test #13 you can search for its name or the string '#13' @@ -43,6 +45,7 @@ BEGIN { ---------- 'def' => "", 'extrude' => "--extrude", + 'git45' => "-vtc=1 -wn", 'here_long' => "-l=33", 'kba1' => <<'----------', -kbb='=> ,' -kba='=>' @@ -121,6 +124,31 @@ catch { 'extrude5' => <<'----------', use perl6-alpha; $var{-y} = 1; +---------- + + 'git45' => <<'----------', +# git#45 -vtc=n and -wn were not working together +if ( + $self->_add_fqdn_host( + name => $name, + realm => $realm + ) + ) +{ + ...; +} + +# do not stack )->pack( +my $hlist = $control::control->Scrolled( + 'HList', + drawbranch => 1, + width => 20, + -scrollbars => 'w' +)->pack( + -side => 'bottom', + -expand => 1 +); + ---------- 'here_long' => <<'----------', @@ -569,6 +597,60 @@ method 'foo2' => #16........... }, + + 'git45.def' => { + source => "git45", + params => "def", + expect => <<'#17...........', +# git#45 -vtc=n and -wn were not working together +if ( + $self->_add_fqdn_host( + name => $name, + realm => $realm + ) + ) +{ + ...; +} + +# do not stack )->pack( +my $hlist = $control::control->Scrolled( + 'HList', + drawbranch => 1, + width => 20, + -scrollbars => 'w' +)->pack( + -side => 'bottom', + -expand => 1 +); + +#17........... + }, + + 'git45.git45' => { + source => "git45", + params => "git45", + expect => <<'#18...........', +# git#45 -vtc=n and -wn were not working together +if ( $self->_add_fqdn_host( + name => $name, + realm => $realm ) ) +{ + ...; +} + +# do not stack )->pack( +my $hlist = $control::control->Scrolled( + 'HList', + drawbranch => 1, + width => 20, + -scrollbars => 'w' +)->pack( + -side => 'bottom', + -expand => 1 ); + +#18........... + }, }; my $ntests = 0 + keys %{$rtests};