From 4e6465c176584238263f13b254341669c98a1f4f Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 15 Sep 2020 16:03:24 -0700 Subject: [PATCH] add test for -bbhb and -bbp --- local-docs/BugLog.pod | 3 ++ t/snippets/bbhb.in | 7 ++++ t/snippets/bbhb2.par | 1 + t/snippets/bbhb3.par | 1 + t/snippets/expect/bbhb.bbhb2 | 8 +++++ t/snippets/expect/bbhb.bbhb3 | 9 +++++ t/snippets/expect/bbhb.def | 7 ++++ t/snippets/packing_list.txt | 3 ++ t/snippets22.t | 65 +++++++++++++++++++++++++++++++++++- 9 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 t/snippets/bbhb.in create mode 100644 t/snippets/bbhb2.par create mode 100644 t/snippets/bbhb3.par create mode 100644 t/snippets/expect/bbhb.bbhb2 create mode 100644 t/snippets/expect/bbhb.bbhb3 create mode 100644 t/snippets/expect/bbhb.def diff --git a/local-docs/BugLog.pod b/local-docs/BugLog.pod index de9ba82a..bce44225 100644 --- a/local-docs/BugLog.pod +++ b/local-docs/BugLog.pod @@ -8,11 +8,14 @@ found with the help of automated random testing. =item B The -> can now be vertically aligned if a space is placed before it with -wls='->'. +Added 15 Sep 2020 as part of previous item, 9ac6af6. =item B These flags give control over the opening token of a multiple-line list. They are described in the man pages, perltidy.html. +Added 15 Sep 2020 in "added flags -bbhb=n, -bbsb=n, -bbq=n, suggestion git #38". +9ac6af6. =item B diff --git a/t/snippets/bbhb.in b/t/snippets/bbhb.in new file mode 100644 index 00000000..98061f6d --- /dev/null +++ b/t/snippets/bbhb.in @@ -0,0 +1,7 @@ +my %temp = +( +supsup => 123, +nested => { +asdf => 456, +yarg => 'yarp', +}, ); diff --git a/t/snippets/bbhb2.par b/t/snippets/bbhb2.par new file mode 100644 index 00000000..cee16b30 --- /dev/null +++ b/t/snippets/bbhb2.par @@ -0,0 +1 @@ +-bbhb=2 -bbp=2 diff --git a/t/snippets/bbhb3.par b/t/snippets/bbhb3.par new file mode 100644 index 00000000..3a346be6 --- /dev/null +++ b/t/snippets/bbhb3.par @@ -0,0 +1 @@ +-bbhb=3 -bbp=3 diff --git a/t/snippets/expect/bbhb.bbhb2 b/t/snippets/expect/bbhb.bbhb2 new file mode 100644 index 00000000..670c04d3 --- /dev/null +++ b/t/snippets/expect/bbhb.bbhb2 @@ -0,0 +1,8 @@ +my %temp = + ( + supsup => 123, + nested => { + asdf => 456, + yarg => 'yarp', + }, + ); diff --git a/t/snippets/expect/bbhb.bbhb3 b/t/snippets/expect/bbhb.bbhb3 new file mode 100644 index 00000000..a39f536a --- /dev/null +++ b/t/snippets/expect/bbhb.bbhb3 @@ -0,0 +1,9 @@ +my %temp = + ( + supsup => 123, + nested => + { + asdf => 456, + yarg => 'yarp', + }, + ); diff --git a/t/snippets/expect/bbhb.def b/t/snippets/expect/bbhb.def new file mode 100644 index 00000000..25acb75c --- /dev/null +++ b/t/snippets/expect/bbhb.def @@ -0,0 +1,7 @@ +my %temp = ( + supsup => 123, + nested => { + asdf => 456, + yarg => 'yarp', + }, +); diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index c1c2cd6f..ee997287 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -411,3 +411,6 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def +../snippets22.t bbhb.bbhb2 +../snippets22.t bbhb.bbhb3 +../snippets22.t bbhb.def diff --git a/t/snippets22.t b/t/snippets22.t index 782c7c48..a640288a 100644 --- a/t/snippets22.t +++ b/t/snippets22.t @@ -2,6 +2,9 @@ # Contents: #1 here_long.here_long +#2 bbhb.bbhb2 +#3 bbhb.bbhb3 +#4 bbhb.def # To locate test #13 you can search for its name or the string '#13' @@ -18,13 +21,28 @@ BEGIN { ########################################### # BEGIN SECTION 1: Parameter combinations # ########################################### - $rparams = { 'here_long' => "-l=33", }; + $rparams = { + 'bbhb2' => "-bbhb=2 -bbp=2", + 'bbhb3' => "-bbhb=3 -bbp=3", + 'def' => "", + 'here_long' => "-l=33", + }; ############################ # BEGIN SECTION 2: Sources # ############################ $rsources = { + 'bbhb' => <<'----------', +my %temp = +( +supsup => 123, +nested => { +asdf => 456, +yarg => 'yarp', +}, ); +---------- + 'here_long' => <<'----------', # must not break after here target regardless of maximum-line-length $sth= $dbh->prepare (<<"END_OF_SELECT") or die "Couldn't prepare SQL" ; @@ -53,6 +71,51 @@ END_OF_SELECT #1........... }, + + 'bbhb.bbhb2' => { + source => "bbhb", + params => "bbhb2", + expect => <<'#2...........', +my %temp = + ( + supsup => 123, + nested => { + asdf => 456, + yarg => 'yarp', + }, + ); +#2........... + }, + + 'bbhb.bbhb3' => { + source => "bbhb", + params => "bbhb3", + expect => <<'#3...........', +my %temp = + ( + supsup => 123, + nested => + { + asdf => 456, + yarg => 'yarp', + }, + ); +#3........... + }, + + 'bbhb.def' => { + source => "bbhb", + params => "def", + expect => <<'#4...........', +my %temp = ( + supsup => 123, + nested => { + asdf => 456, + yarg => 'yarp', + }, +); +#4........... + }, }; my $ntests = 0 + keys %{$rtests}; -- 2.39.5