From 7ef4b5e9762dbee1d209b695849a50da0ef60e52 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Tue, 10 Nov 2020 17:03:42 -0800 Subject: [PATCH] added test cases to improve parameter coverage --- bin/perltidy | 1 - docs/ChangeLog.html | 31 +- t/snippets/boa.in | 5 + t/snippets/boa.par | 2 + t/snippets/bol.in | 2 + t/snippets/bol.par | 2 + t/snippets/bot.in | 4 + t/snippets/bot.par | 2 + t/snippets/coverage_missing.txt | 8 - t/snippets/coverage_values.txt | 932 ++++++++++++++------------ t/snippets/expect/boa.boa | 1 + t/snippets/expect/boa.def | 5 + t/snippets/expect/bol.bol | 1 + t/snippets/expect/bol.def | 5 + t/snippets/expect/bot.bot | 1 + t/snippets/expect/bot.def | 4 + t/snippets/expect/hash_bang.def | 4 + t/snippets/expect/hash_bang.hash_bang | 7 + t/snippets/expect/listop1.listop1 | 2 + t/snippets/expect/sbcp.def | 7 + t/snippets/expect/sbcp.sbcp1 | 6 + t/snippets/hash_bang.in | 7 + t/snippets/hash_bang.par | 1 + t/snippets/listop1.par | 2 + t/snippets/packing_list.txt | 11 + t/snippets/sbcp.in | 6 + t/snippets/sbcp1.par | 1 + t/snippets22.t | 29 +- t/snippets23.t | 277 ++++++++ 29 files changed, 927 insertions(+), 439 deletions(-) create mode 100644 t/snippets/boa.in create mode 100644 t/snippets/boa.par create mode 100644 t/snippets/bol.in create mode 100644 t/snippets/bol.par create mode 100644 t/snippets/bot.in create mode 100644 t/snippets/bot.par create mode 100644 t/snippets/expect/boa.boa create mode 100644 t/snippets/expect/boa.def create mode 100644 t/snippets/expect/bol.bol create mode 100644 t/snippets/expect/bol.def create mode 100644 t/snippets/expect/bot.bot create mode 100644 t/snippets/expect/bot.def create mode 100644 t/snippets/expect/hash_bang.def create mode 100644 t/snippets/expect/hash_bang.hash_bang create mode 100644 t/snippets/expect/listop1.listop1 create mode 100644 t/snippets/expect/sbcp.def create mode 100644 t/snippets/expect/sbcp.sbcp1 create mode 100644 t/snippets/hash_bang.in create mode 100644 t/snippets/hash_bang.par create mode 100644 t/snippets/listop1.par create mode 100644 t/snippets/sbcp.in create mode 100644 t/snippets/sbcp1.par create mode 100644 t/snippets23.t diff --git a/bin/perltidy b/bin/perltidy index a9d9bf10..dda84aa6 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -3074,7 +3074,6 @@ on a single line if possible. To prevent this, and thereby always form longer lines, use B<-nboa>. - =item Keeping old breakpoints at specific token types Two command line parameters provide detailed control over whether diff --git a/docs/ChangeLog.html b/docs/ChangeLog.html index 9ccbe2f8..bb3ae09b 100644 --- a/docs/ChangeLog.html +++ b/docs/ChangeLog.html @@ -2,7 +2,11 @@

2020 10 01.03

-
- Fixed issue git #44, -vtc=n flag was ignored when -wn was set.
+
- This release is being made to make available a number of new formatting 
+  parameters. No significant bugs have been found since the previous release, 
+  but several minor issues have been found and fixed as listed below.
+
+- Fixed issue git #45, -vtc=n flag was ignored when -wn was set.
 
 - implement request RT #133649, delete-old-newlines selectively. Two parameters, 
 
@@ -46,8 +50,6 @@
 
 - Fix issue git #41, typo in manual regarding -fsb.
 
-- Some problems with parsing complex multi-line sub signatures have been fixed.
-
 - Fix issue git #40: when using the -bli option, a closing brace followed by 
   a semicolon was not being indented.  This applies to braces which require 
   semicolons, such as a 'do' block.
@@ -57,6 +59,29 @@
 - This version is about 15% faster than previous versions due to some optimizations
   made with the help of Devel::NYTProf.
 
+- Line breaks are now automatically placed after 'use overload' to 
+  improve formatting when there are numerous overloaded operators.  For
+  example
+
+    use overload
+      '+' => sub {
+      ...
+
+- A number of minor problems with parsing signatures and prototypes have
+  been corrected, particularly multi-line signatures. Some signatures 
+  had previously been parsed as if they were prototypes, which meant the 
+  normal spacing rules were not applied.  For example
+
+  OLD:
+    sub echo ($message= 'Hello World!' ) {
+        ...;
+    }
+
+  NEW:
+    sub echo ( $message = 'Hello World!' ) {
+        ...;
+    }
+
 - Numerous minor issues that the average user would not encounter were found
   and fixed. They can be seen in the more complete list of updates at 
 
diff --git a/t/snippets/boa.in b/t/snippets/boa.in
new file mode 100644
index 00000000..f2c2f9bd
--- /dev/null
+++ b/t/snippets/boa.in
@@ -0,0 +1,5 @@
+my @field
+  : field
+  : Default(1)
+  : Get('Name' => 'foo') 
+  : Set('Name');
diff --git a/t/snippets/boa.par b/t/snippets/boa.par
new file mode 100644
index 00000000..5b68fa6a
--- /dev/null
+++ b/t/snippets/boa.par
@@ -0,0 +1,2 @@
+# -boa is default so we test nboa
+-nboa
diff --git a/t/snippets/bol.in b/t/snippets/bol.in
new file mode 100644
index 00000000..d5e380ce
--- /dev/null
+++ b/t/snippets/bol.in
@@ -0,0 +1,2 @@
+return unless $cmd = $cmd || ($dot 
+          && $Last_Shell) || &prompt('|');
diff --git a/t/snippets/bol.par b/t/snippets/bol.par
new file mode 100644
index 00000000..f9c96779
--- /dev/null
+++ b/t/snippets/bol.par
@@ -0,0 +1,2 @@
+# -bol is default, so test -nbol
+-nbol
diff --git a/t/snippets/bot.in b/t/snippets/bot.in
new file mode 100644
index 00000000..f857f138
--- /dev/null
+++ b/t/snippets/bot.in
@@ -0,0 +1,4 @@
+$foo =
+  $condition
+  ? undef
+  : 1;
diff --git a/t/snippets/bot.par b/t/snippets/bot.par
new file mode 100644
index 00000000..d59b5716
--- /dev/null
+++ b/t/snippets/bot.par
@@ -0,0 +1,2 @@
+# -bot is default so we test -nbot
+-nbot
diff --git a/t/snippets/coverage_missing.txt b/t/snippets/coverage_missing.txt
index da619b70..50e50d0a 100644
--- a/t/snippets/coverage_missing.txt
+++ b/t/snippets/coverage_missing.txt
@@ -4,12 +4,7 @@ assert-tidy
 assert-untidy
 backlink
 block-brace-vertical-tightness-list
-break-at-old-attribute-breakpoints
-break-at-old-keyword-breakpoints
-break-at-old-logical-breakpoints
-break-at-old-ternary-breakpoints
 cachedir
-closing-side-comment-list
 closing-side-comment-prefix
 closing-side-comment-warnings
 closing-token-indentation
@@ -97,7 +92,6 @@ libpods
 logfile
 logfile-gap
 look-for-autoloader
-look-for-hash-bang
 look-for-selfloader
 memoize
 no-profile
@@ -122,9 +116,7 @@ podverbose
 preserve-line-endings
 profile
 show-options
-stack-opening-block-brace
 standard-output
-static-block-comment-prefix
 static-side-comment-prefix
 stylesheet
 tabs
diff --git a/t/snippets/coverage_values.txt b/t/snippets/coverage_values.txt
index 2361ebf9..be567197 100644
--- a/t/snippets/coverage_values.txt
+++ b/t/snippets/coverage_values.txt
@@ -1,476 +1,577 @@
 $VAR1 = {
-          'short-concatenation-item-length' => [
-                                                 12,
-                                                 8
-                                               ],
-          'line-up-parentheses' => [
-                                     0,
-                                     1
-                                   ],
-          'blank-lines-before-subs' => [
-                                         0,
-                                         1
-                                       ],
-          'closing-side-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'stack-closing-hash-brace' => [
-                                          0,
-                                          1
-                                        ],
-          'closing-paren-indentation' => [
-                                           0,
-                                           1,
-                                           2
-                                         ],
-          'delete-side-comments' => [
-                                      0,
+          'cuddled-break-option' => [
                                       1
                                     ],
-          'backup-and-modify-in-place' => [
-                                            0,
-                                            1
-                                          ],
-          'space-backslash-quote' => [
-                                       0,
-                                       1,
-                                       2
-                                     ],
-          'warning-output' => [
-                                0,
-                                1
-                              ],
-          'outdent-keywords' => [
-                                  0,
-                                  1
-                                ],
+          'nowant-right-space' => [
+                                    '+ -',
+                                    '+ - / *',
+                                    '++ --',
+                                    '..',
+                                    '= + - / *',
+                                    'A'
+                                  ],
+          'iterations' => [
+                            1,
+                            4
+                          ],
+          'break-at-old-ternary-breakpoints' => [
+                                                  0,
+                                                  1
+                                                ],
+          'square-bracket-vertical-tightness-closing' => [
+                                                           0,
+                                                           1,
+                                                           2
+                                                         ],
+          'format' => [
+                        'html',
+                        'tidy'
+                      ],
+          'keyword-group-blanks-delete' => [
+                                             0,
+                                             1
+                                           ],
+          'break-at-old-attribute-breakpoints' => [
+                                                    0,
+                                                    1
+                                                  ],
+          'comma-arrow-breakpoints' => [
+                                         1,
+                                         5
+                                       ],
           'maximum-line-length' => [
                                      0,
                                      1,
                                      100,
                                      100000,
                                      160,
+                                     33,
                                      77,
                                      78,
                                      80
                                    ],
-          'paren-tightness' => [
-                                 0,
-                                 1,
-                                 2
-                               ],
-          'starting-indentation-level' => [
-                                            0
-                                          ],
-          'break-before-all-operators' => [
-                                            0,
-                                            1
-                                          ],
-          'outdent-static-block-comments' => [
-                                               0,
-                                               1
-                                             ],
-          'delete-closing-side-comments' => [
+          'opening-square-bracket-right' => [
                                               0,
                                               1
                                             ],
-          'ignore-old-breakpoints' => [
-                                        0,
-                                        1
-                                      ],
-          'fuzzy-line-length' => [
-                                   0,
-                                   1
+          'line-up-parentheses' => [
+                                     0,
+                                     1
+                                   ],
+          'brace-vertical-tightness' => [
+                                          0,
+                                          1,
+                                          2
+                                        ],
+          'brace-left-and-indent-list' => [
+                                            '*',
+                                            'if'
+                                          ],
+          'nowant-left-space' => [
+                                   '+ - / *',
+                                   '++ -- ?',
+                                   '..',
+                                   '= + - / *',
+                                   '= / *'
                                  ],
-          'add-newlines' => [
+          'opening-sub-brace-on-new-line' => [
+                                               0,
+                                               1
+                                             ],
+          'want-right-space' => [
+                                  '->',
+                                  '= .= =~ !~ ? :',
+                                  '= / *'
+                                ],
+          'cuddled-else' => [
                               0,
                               1
                             ],
-          'keep-interior-semicolons' => [
+          'paren-tightness' => [
+                                 0,
+                                 1,
+                                 2
+                               ],
+          'indent-columns' => [
+                                0,
+                                2,
+                                4
+                              ],
+          'paren-vertical-tightness' => [
+                                          0,
+                                          1,
+                                          2
+                                        ],
+          'break-at-old-semicolon-breakpoints' => [
+                                                    0,
+                                                    1
+                                                  ],
+          'space-keyword-paren' => [
+                                     0,
+                                     1
+                                   ],
+          'opening-paren-right' => [
+                                     0,
+                                     1
+                                   ],
+          'maximum-file-size-mb' => [
+                                      10
+                                    ],
+          'outdent-long-quotes' => [
+                                     0,
+                                     1
+                                   ],
+          'maximum-consecutive-blank-lines' => [
+                                                 0,
+                                                 1,
+                                                 2
+                                               ],
+          'space-terminal-semicolon' => [
                                           0,
                                           1
                                         ],
-          'closing-brace-indentation' => [
+          'stack-opening-hash-brace' => [
+                                          0,
+                                          1
+                                        ],
+          'closing-paren-indentation' => [
                                            0,
                                            1,
                                            2
                                          ],
-          'closing-square-bracket-indentation' => [
-                                                    0,
-                                                    1,
-                                                    2
-                                                  ],
-          'trim-pod' => [
-                          0,
-                          1
-                        ],
-          'format-skipping' => [
-                                 0,
-                                 1
-                               ],
           'keyword-group-blanks-inside' => [
                                              0,
                                              1
                                            ],
-          'tight-secret-operators' => [
+          'maximum-unexpected-errors' => [
+                                           0
+                                         ],
+          'non-indenting-brace-prefix' => [
+                                            '#\\+\\+'
+                                          ],
+          'delete-old-whitespace' => [
+                                       0,
+                                       1
+                                     ],
+          'brace-left-and-indent' => [
+                                       0,
+                                       1
+                                     ],
+          'static-side-comments' => [
+                                      0,
+                                      1
+                                    ],
+          'opening-anonymous-sub-brace-on-new-line' => [
+                                                         0,
+                                                         1
+                                                       ],
+          'default-tabsize' => [
+                                 8
+                               ],
+          'break-before-all-operators' => [
+                                            0,
+                                            1
+                                          ],
+          'closing-side-comment-interval' => [
+                                               2,
+                                               20,
+                                               6
+                                             ],
+          'fuzzy-line-length' => [
+                                   0,
+                                   1
+                                 ],
+          'break-before-square-bracket-and-indent' => [
+                                                        0
+                                                      ],
+          'one-line-block-nesting' => [
                                         0,
                                         1
                                       ],
-          'indent-columns' => [
-                                0,
-                                2,
-                                4
-                              ],
-          'closing-side-comment-maximum-text' => [
-                                                   20,
-                                                   40
-                                                 ],
-          'timestamp' => [
-                           0,
-                           1
-                         ],
-          'outdent-long-quotes' => [
+          'stack-opening-paren' => [
                                      0,
                                      1
                                    ],
-          'stack-closing-block-brace' => [
+          'keep-old-breakpoints-after' => [
+                                            '=>'
+                                          ],
+          'opening-brace-always-on-right' => [
+                                               0,
+                                               1
+                                             ],
+          'logical-padding' => [
+                                 0,
+                                 1
+                               ],
+          'indent-block-comments' => [
+                                       0,
+                                       1
+                                     ],
+          'brace-vertical-tightness-closing' => [
+                                                  0,
+                                                  1,
+                                                  2
+                                                ],
+          'closing-brace-indentation' => [
                                            0,
-                                           1
+                                           1,
+                                           2
                                          ],
-          'hanging-side-comments' => [
+          'break-at-old-comma-breakpoints' => [
+                                                0,
+                                                1
+                                              ],
+          'break-at-old-method-breakpoints' => [
+                                                 0,
+                                                 1
+                                               ],
+          'opening-hash-brace-right' => [
+                                          0,
+                                          1
+                                        ],
+          'indent-closing-brace' => [
+                                      0,
+                                      1
+                                    ],
+          'keyword-group-blanks-after' => [
+                                            1,
+                                            2
+                                          ],
+          'delete-pod' => [
+                            0,
+                            1
+                          ],
+          'sub-alias-list' => [
+                                'method',
+                                'method fun'
+                              ],
+          'add-semicolons' => [
+                                0,
+                                1
+                              ],
+          'static-block-comments' => [
                                        0,
                                        1
                                      ],
-          'closing-side-comment-else-flag' => [
-                                                0
-                                              ],
-          'weld-nested-containers' => [
-                                        0,
-                                        1
-                                      ],
           'square-bracket-tightness' => [
                                           0,
                                           1,
                                           2
                                         ],
-          'want-break-before' => [
-                                   ' ',
-                                   '% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=',
-                                   '% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=',
-                                   '='
-                                 ],
-          'delete-semicolons' => [
-                                   0,
-                                   1
-                                 ],
-          'square-bracket-vertical-tightness-closing' => [
-                                                           0,
-                                                           2
-                                                         ],
-          'recombine' => [
-                           0,
-                           1
-                         ],
-          'delete-block-comments' => [
+          'cuddled-block-list' => [
+                                    'map,sort,grep',
+                                    'sort,map,grep'
+                                  ],
+          'closing-side-comments' => [
                                        0,
                                        1
                                      ],
-          'add-whitespace' => [
-                                0,
-                                1
-                              ],
-          'default-tabsize' => [
-                                 8
-                               ],
-          'format-skipping-end' => [
-                                     '#>{2,}'
-                                   ],
-          'stack-closing-square-bracket' => [
+          'backup-and-modify-in-place' => [
+                                            0,
+                                            1
+                                          ],
+          'block-brace-tightness' => [
+                                       0,
+                                       1,
+                                       2
+                                     ],
+          'trim-pod' => [
+                          0,
+                          1
+                        ],
+          'block-brace-vertical-tightness' => [
+                                                0,
+                                                1
+                                              ],
+          'delete-closing-side-comments' => [
                                               0,
                                               1
                                             ],
-          'backup-file-extension' => [
-                                       'bak',
-                                       '~'
-                                     ],
-          'outdent-keyword-list' => [
-                                      'next'
-                                    ],
-          'brace-vertical-tightness' => [
+          'short-concatenation-item-length' => [
+                                                 12,
+                                                 8
+                                               ],
+          'stack-closing-block-brace' => [
+                                           0,
+                                           1
+                                         ],
+          'continuation-indentation' => [
                                           0,
-                                          1,
-                                          2
+                                          2,
+                                          4
                                         ],
-          'want-right-space' => [
-                                  '= .= =~ !~ ? :',
-                                  '= / *'
-                                ],
-          'static-block-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'closing-side-comment-interval' => [
-                                               2,
-                                               20,
-                                               6
-                                             ],
-          'long-block-line-count' => [
-                                       8
-                                     ],
-          'add-semicolons' => [
-                                0,
-                                1
-                              ],
+          'format-skipping' => [
+                                 0,
+                                 1
+                               ],
           'nospace-after-keyword' => [
                                        'my for'
                                      ],
-          'space-keyword-paren' => [
-                                     0,
-                                     1
-                                   ],
-          'nowant-left-space' => [
-                                   '+ - / *',
-                                   '++ -- ?',
-                                   '..',
-                                   '= + - / *',
-                                   '= / *'
-                                 ],
-          'space-function-paren' => [
-                                      0,
+          'keyword-paren-inner-tightness-list' => [
+                                                    'return factorial'
+                                                  ],
+          'maximum-level-errors' => [
                                       1
                                     ],
-          'opening-sub-brace-on-new-line' => [
-                                               0,
-                                               1
-                                             ],
-          'variable-maximum-line-length' => [
+          'want-left-space' => [
+                                 '+ -',
+                                 '->',
+                                 '= .= =~ !~ :'
+                               ],
+          'fixed-position-side-comment' => [
+                                             40
+                                           ],
+          'keep-interior-semicolons' => [
+                                          0,
+                                          1
+                                        ],
+          'outdent-keywords' => [
+                                  0,
+                                  1
+                                ],
+          'stack-opening-square-bracket' => [
                                               0,
                                               1
                                             ],
-          'delete-pod' => [
-                            0,
-                            1
-                          ],
-          'maximum-fields-per-table' => [
-                                          0
-                                        ],
-          'paren-vertical-tightness-closing' => [
-                                                  0,
-                                                  2
-                                                ],
           'ignore-side-comment-lengths' => [
                                              0,
                                              1
                                            ],
-          'delete-old-whitespace' => [
+          'want-break-before' => [
+                                   ' ',
+                                   '% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=',
+                                   '% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=',
+                                   '='
+                                 ],
+          'non-indenting-braces' => [
+                                      0,
+                                      1
+                                    ],
+          'timestamp' => [
+                           0,
+                           1
+                         ],
+          'opening-brace-on-new-line' => [
+                                           0,
+                                           1
+                                         ],
+          'delete-semicolons' => [
+                                   0,
+                                   1
+                                 ],
+          'keyword-group-blanks-size' => [
+                                           '5'
+                                         ],
+          'ignore-old-breakpoints' => [
+                                        0,
+                                        1
+                                      ],
+          'delete-block-comments' => [
                                        0,
                                        1
                                      ],
-          'check-syntax' => [
+          'closing-side-comment-maximum-text' => [
+                                                   20,
+                                                   40
+                                                 ],
+          'add-newlines' => [
                               0,
                               1
                             ],
+          'stack-closing-paren' => [
+                                     0,
+                                     1
+                                   ],
           'entab-leading-whitespace' => [
                                           8
                                         ],
-          'whitespace-cycle' => [
-                                  4
-                                ],
-          'block-brace-tightness' => [
-                                       0,
-                                       1,
-                                       2
+          'perl-syntax-check-flags' => [
+                                         '-c -T'
+                                       ],
+          'blank-lines-before-packages' => [
+                                             0,
+                                             1
+                                           ],
+          'long-block-line-count' => [
+                                       8
                                      ],
           'keyword-group-blanks-before' => [
                                              1,
                                              2
                                            ],
-          'cuddled-else' => [
-                              0,
-                              1
-                            ],
-          'keyword-group-blanks-repeat-count' => [
-                                                   0
-                                                 ],
-          'cuddled-block-list' => [
-                                    'map,sort,grep',
-                                    'sort,map,grep'
-                                  ],
-          'nowant-right-space' => [
-                                    '+ -',
-                                    '+ - / *',
-                                    '++ --',
-                                    '..',
-                                    '= + - / *',
-                                    'A'
-                                  ],
-          'stack-closing-paren' => [
-                                     0,
-                                     1
-                                   ],
-          'maximum-consecutive-blank-lines' => [
-                                                 0,
-                                                 1,
-                                                 2
-                                               ],
-          'outdent-labels' => [
-                                0,
-                                1
-                              ],
-          'cuddled-break-option' => [
+          'stack-closing-square-bracket' => [
+                                              0,
+                                              1
+                                            ],
+          'break-at-old-keyword-breakpoints' => [
+                                                  0,
+                                                  1
+                                                ],
+          'space-function-paren' => [
+                                      0,
                                       1
                                     ],
+          'keep-old-breakpoints-before' => [
+                                             '=> ,'
+                                           ],
+          'tight-secret-operators' => [
+                                        0,
+                                        1
+                                      ],
+          'space-after-keyword' => [
+                                     'push'
+                                   ],
           'indent-spaced-block-comments' => [
                                               0,
                                               1
                                             ],
-          'closing-side-comments-balanced' => [
-                                                0,
-                                                1
-                                              ],
-          'blank-lines-before-closing-block' => [
-                                                  1
-                                                ],
-          'brace-vertical-tightness-closing' => [
+          'break-before-paren-and-indent' => [
+                                               0,
+                                               1,
+                                               2
+                                             ],
+          'paren-vertical-tightness-closing' => [
                                                   0,
+                                                  1,
                                                   2
                                                 ],
-          'opening-brace-on-new-line' => [
-                                           0,
-                                           1
-                                         ],
-          'blank-lines-after-opening-block-list' => [
-                                                      '*'
-                                                    ],
-          'one-line-block-semicolons' => [
-                                           0,
-                                           1,
-                                           2
-                                         ],
-          'perl-syntax-check-flags' => [
-                                         '-c -T'
-                                       ],
-          'comma-arrow-breakpoints' => [
-                                         1,
-                                         5
-                                       ],
-          'opening-paren-right' => [
+          'delete-old-newlines' => [
                                      0,
                                      1
                                    ],
-          'opening-hash-brace-right' => [
-                                          0,
-                                          1
-                                        ],
-          'static-side-comments' => [
-                                      0,
-                                      1
-                                    ],
-          'keyword-group-blanks-after' => [
-                                            1,
-                                            2
+          'starting-indentation-level' => [
+                                            0
                                           ],
-          'blanks-before-blocks' => [
+          'weld-nested-containers' => [
+                                        0,
+                                        1
+                                      ],
+          'check-syntax' => [
+                              0,
+                              1
+                            ],
+          'backup-file-extension' => [
+                                       'bak',
+                                       '~'
+                                     ],
+          'look-for-hash-bang' => [
+                                    0,
+                                    1
+                                  ],
+          'break-before-hash-brace-and-indent' => [
+                                                    0,
+                                                    1,
+                                                    2
+                                                  ],
+          'blank-lines-before-subs' => [
+                                         0,
+                                         1
+                                       ],
+          'blank-lines-before-closing-block-list' => [
+                                                       '*'
+                                                     ],
+          'delete-side-comments' => [
                                       0,
                                       1
                                     ],
-          'format-skipping-begin' => [
-                                       '#<{2,}'
+          'one-line-block-semicolons' => [
+                                           0,
+                                           1,
+                                           2
+                                         ],
+          'keyword-group-blanks-repeat-count' => [
+                                                   0
+                                                 ],
+          'break-before-square-bracket' => [
+                                             0
+                                           ],
+          'static-block-comment-prefix' => [
+                                             '#x#'
+                                           ],
+          'space-backslash-quote' => [
+                                       0,
+                                       1,
+                                       2
                                      ],
-          'one-line-block-nesting' => [
-                                        0,
-                                        1
-                                      ],
-          'opening-square-bracket-right' => [
-                                              0,
-                                              1
-                                            ],
+          'closing-side-comments-balanced' => [
+                                                0,
+                                                1
+                                              ],
+          'outdent-labels' => [
+                                0,
+                                1
+                              ],
+          'closing-square-bracket-indentation' => [
+                                                    0,
+                                                    1,
+                                                    2
+                                                  ],
+          'add-whitespace' => [
+                                0,
+                                1
+                              ],
+          'recombine' => [
+                           0,
+                           1
+                         ],
+          'format-skipping-end' => [
+                                     '#>{2,}'
+                                   ],
           'break-after-all-operators' => [
                                            0,
                                            1
                                          ],
-          'outdent-long-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'opening-brace-always-on-right' => [
+          'character-encoding' => [
+                                    'guess'
+                                  ],
+          'want-break-after' => [
+                                  '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||'
+                                ],
+          'blank-lines-before-closing-block' => [
+                                                  1
+                                                ],
+          'whitespace-cycle' => [
+                                  4
+                                ],
+          'keyword-paren-inner-tightness' => [
                                                0,
                                                1
                                              ],
-          'keyword-group-blanks-size' => [
-                                           '5'
-                                         ],
-          'keep-old-blank-lines' => [
-                                      0,
-                                      1,
-                                      2
-                                    ],
-          'paren-vertical-tightness' => [
-                                          0,
-                                          1,
-                                          2
-                                        ],
-          'indent-closing-brace' => [
+          'break-before-hash-brace' => [
+                                         0,
+                                         2,
+                                         3
+                                       ],
+          'blanks-before-blocks' => [
                                       0,
                                       1
                                     ],
-          'stack-opening-square-bracket' => [
-                                              0,
-                                              1
-                                            ],
-          'blanks-before-comments' => [
-                                        0,
-                                        1
-                                      ],
-          'stack-opening-paren' => [
-                                     0,
-                                     1
-                                   ],
-          'brace-left-and-indent' => [
+          'maximum-fields-per-table' => [
+                                          0
+                                        ],
+          'closing-side-comment-list' => [
+                                           'sub'
+                                         ],
+          'hanging-side-comments' => [
                                        0,
                                        1
                                      ],
-          'block-brace-vertical-tightness' => [
-                                                0,
-                                                1
-                                              ],
-          'brace-left-and-indent-list' => [
-                                            'if'
-                                          ],
-          'standard-error-output' => [
+          'outdent-long-comments' => [
                                        0,
                                        1
                                      ],
-          'want-left-space' => [
-                                 '+ -',
-                                 '= .= =~ !~ :'
-                               ],
-          'keyword-paren-inner-tightness' => [
-                                               0,
-                                               1
-                                             ],
-          'brace-tightness' => [
-                                 0,
-                                 1,
-                                 2
-                               ],
-          'blank-lines-before-packages' => [
-                                             0,
-                                             1
-                                           ],
-          'blank-lines-before-closing-block-list' => [
-                                                       '*'
-                                                     ],
-          'iterations' => [
-                            1,
-                            4
-                          ],
-          'continuation-indentation' => [
-                                          0,
-                                          2,
-                                          4
-                                        ],
+          'format-skipping-begin' => [
+                                       '#<{2,}'
+                                     ],
+          'blanks-before-comments' => [
+                                        0,
+                                        1
+                                      ],
+          'keep-old-blank-lines' => [
+                                      0,
+                                      1,
+                                      2
+                                    ],
           'space-prototype-paren' => [
                                        0,
                                        1,
@@ -480,83 +581,68 @@ $VAR1 = {
                        0,
                        1
                      ],
-          'break-at-old-method-breakpoints' => [
-                                                 0,
-                                                 1
-                                               ],
-          'keyword-group-blanks-delete' => [
-                                             0,
-                                             1
-                                           ],
-          'break-at-old-semicolon-breakpoints' => [
-                                                    0,
-                                                    1
-                                                  ],
-          'want-break-after' => [
-                                  '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||'
-                                ],
-          'minimum-space-to-comment' => [
-                                          10,
-                                          2,
-                                          4
-                                        ],
-          'break-at-old-comma-breakpoints' => [
-                                                0,
-                                                1
-                                              ],
-          'logical-padding' => [
-                                 0,
-                                 1
-                               ],
-          'space-terminal-semicolon' => [
+          'break-at-old-logical-breakpoints' => [
+                                                  0,
+                                                  1
+                                                ],
+          'outdent-static-block-comments' => [
+                                               0,
+                                               1
+                                             ],
+          'stack-closing-hash-brace' => [
                                           0,
                                           1
                                         ],
-          'format' => [
-                        'html',
-                        'tidy'
-                      ],
-          'indent-block-comments' => [
+          'blank-lines-after-opening-block-list' => [
+                                                      '*'
+                                                    ],
+          'standard-error-output' => [
                                        0,
                                        1
                                      ],
-          'space-after-keyword' => [
-                                     'push'
+          'space-for-semicolon' => [
+                                     0,
+                                     1
                                    ],
+          'minimum-space-to-comment' => [
+                                          10,
+                                          2,
+                                          4
+                                        ],
+          'warning-output' => [
+                                0,
+                                1
+                              ],
+          'break-before-paren' => [
+                                    0,
+                                    2,
+                                    3
+                                  ],
+          'closing-side-comment-else-flag' => [
+                                                0
+                                              ],
           'square-bracket-vertical-tightness' => [
                                                    0,
                                                    1,
                                                    2
                                                  ],
-          'sub-alias-list' => [
-                                'method fun'
-                              ],
-          'delete-old-newlines' => [
-                                     0,
-                                     1
-                                   ],
-          'opening-anonymous-sub-brace-on-new-line' => [
-                                                         0,
-                                                         1
-                                                       ],
-          'space-for-semicolon' => [
-                                     0,
-                                     1
-                                   ],
-          'fixed-position-side-comment' => [
-                                             40
-                                           ],
-          'keyword-paren-inner-tightness-list' => [
-                                                    'return factorial'
-                                                  ],
-          'character-encoding' => [
-                                    'guess'
-                                  ],
           'blank-lines-after-opening-block' => [
                                                  2
                                                ],
-          'stack-opening-hash-brace' => [
-                                          0,
-                                          1
-                                        ]
+          'extended-continuation-indentation' => [
+                                                   0,
+                                                   1
+                                                 ],
+          'brace-tightness' => [
+                                 0,
+                                 1,
+                                 2
+                               ],
+          'outdent-keyword-list' => [
+                                      'next'
+                                    ],
+          'variable-maximum-line-length' => [
+                                              0,
+                                              1
+                                            ]
         };
diff --git a/t/snippets/expect/boa.boa b/t/snippets/expect/boa.boa
new file mode 100644
index 00000000..fc77f416
--- /dev/null
+++ b/t/snippets/expect/boa.boa
@@ -0,0 +1 @@
+my @field : field : Default(1) : Get('Name' => 'foo') : Set('Name');
diff --git a/t/snippets/expect/boa.def b/t/snippets/expect/boa.def
new file mode 100644
index 00000000..3dc8671f
--- /dev/null
+++ b/t/snippets/expect/boa.def
@@ -0,0 +1,5 @@
+my @field
+  : field
+  : Default(1)
+  : Get('Name' => 'foo')
+  : Set('Name');
diff --git a/t/snippets/expect/bol.bol b/t/snippets/expect/bol.bol
new file mode 100644
index 00000000..78c6a0f6
--- /dev/null
+++ b/t/snippets/expect/bol.bol
@@ -0,0 +1 @@
+return unless $cmd = $cmd || ( $dot && $Last_Shell ) || &prompt('|');
diff --git a/t/snippets/expect/bol.def b/t/snippets/expect/bol.def
new file mode 100644
index 00000000..4a3ebb4c
--- /dev/null
+++ b/t/snippets/expect/bol.def
@@ -0,0 +1,5 @@
+return
+  unless $cmd = $cmd
+  || ( $dot
+    && $Last_Shell )
+  || &prompt('|');
diff --git a/t/snippets/expect/bot.bot b/t/snippets/expect/bot.bot
new file mode 100644
index 00000000..52a97008
--- /dev/null
+++ b/t/snippets/expect/bot.bot
@@ -0,0 +1 @@
+$foo = $condition ? undef : 1;
diff --git a/t/snippets/expect/bot.def b/t/snippets/expect/bot.def
new file mode 100644
index 00000000..f857f138
--- /dev/null
+++ b/t/snippets/expect/bot.def
@@ -0,0 +1,4 @@
+$foo =
+  $condition
+  ? undef
+  : 1;
diff --git a/t/snippets/expect/hash_bang.def b/t/snippets/expect/hash_bang.def
new file mode 100644
index 00000000..12b7f2c4
--- /dev/null
+++ b/t/snippets/expect/hash_bang.def
@@ -0,0 +1,4 @@
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
diff --git a/t/snippets/expect/hash_bang.hash_bang b/t/snippets/expect/hash_bang.hash_bang
new file mode 100644
index 00000000..33eb8bf2
--- /dev/null
+++ b/t/snippets/expect/hash_bang.hash_bang
@@ -0,0 +1,7 @@
+
+
+
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
diff --git a/t/snippets/expect/listop1.listop1 b/t/snippets/expect/listop1.listop1
new file mode 100644
index 00000000..6b432d31
--- /dev/null
+++ b/t/snippets/expect/listop1.listop1
@@ -0,0 +1,2 @@
+my @sorted =
+  map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, rand ] } @list;
diff --git a/t/snippets/expect/sbcp.def b/t/snippets/expect/sbcp.def
new file mode 100644
index 00000000..5033b60e
--- /dev/null
+++ b/t/snippets/expect/sbcp.def
@@ -0,0 +1,7 @@
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+
+    #x# 'Dec', 'Nov'
+## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
diff --git a/t/snippets/expect/sbcp.sbcp1 b/t/snippets/expect/sbcp.sbcp1
new file mode 100644
index 00000000..5adbaef9
--- /dev/null
+++ b/t/snippets/expect/sbcp.sbcp1
@@ -0,0 +1,6 @@
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+#x# 'Dec', 'Nov'
+    ## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
diff --git a/t/snippets/hash_bang.in b/t/snippets/hash_bang.in
new file mode 100644
index 00000000..33eb8bf2
--- /dev/null
+++ b/t/snippets/hash_bang.in
@@ -0,0 +1,7 @@
+
+
+
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
diff --git a/t/snippets/hash_bang.par b/t/snippets/hash_bang.par
new file mode 100644
index 00000000..670c7b14
--- /dev/null
+++ b/t/snippets/hash_bang.par
@@ -0,0 +1 @@
+-x
diff --git a/t/snippets/listop1.par b/t/snippets/listop1.par
new file mode 100644
index 00000000..3c29a363
--- /dev/null
+++ b/t/snippets/listop1.par
@@ -0,0 +1,2 @@
+# -bok is default so we test nbok
+-nbok
diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt
index 943a49d4..3f7cc1a8 100644
--- a/t/snippets/packing_list.txt
+++ b/t/snippets/packing_list.txt
@@ -428,3 +428,14 @@
 ../snippets9.t	rt98902.def
 ../snippets9.t	rt98902.rt98902
 ../snippets9.t	rt99961.def
+../snippets22.t	boa.boa
+../snippets23.t	boa.def
+../snippets23.t	bol.bol
+../snippets23.t	bol.def
+../snippets23.t	bot.bot
+../snippets23.t	bot.def
+../snippets23.t	hash_bang.def
+../snippets23.t	hash_bang.hash_bang
+../snippets23.t	listop1.listop1
+../snippets23.t	sbcp.def
+../snippets23.t	sbcp.sbcp1
diff --git a/t/snippets/sbcp.in b/t/snippets/sbcp.in
new file mode 100644
index 00000000..a06b73c5
--- /dev/null
+++ b/t/snippets/sbcp.in
@@ -0,0 +1,6 @@
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+#x# 'Dec', 'Nov'
+## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
diff --git a/t/snippets/sbcp1.par b/t/snippets/sbcp1.par
new file mode 100644
index 00000000..dc51fa94
--- /dev/null
+++ b/t/snippets/sbcp1.par
@@ -0,0 +1 @@
+-sbc -sbcp='#x#'
diff --git a/t/snippets22.t b/t/snippets22.t
index 0ef67a3d..12567450 100644
--- a/t/snippets22.t
+++ b/t/snippets22.t
@@ -19,6 +19,7 @@
 #16 kba1.kba1
 #17 git45.def
 #18 git45.git45
+#19 boa.boa
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -36,10 +37,14 @@ BEGIN {
     # BEGIN SECTION 1: Parameter combinations #
     ###########################################
     $rparams = {
-        'bbhb2'   => "-bbhb=2 -bbp=2",
-        'bbhb3'   => "-bbhb=3 -bbp=3",
-        'bbhb4'   => "-bbhb=3 -bbp=3 -bbhbi=2 -bbpi=2",
-        'bbhb5'   => "-bbhb=3 -bbp=3 -bbhbi=1 -bbpi=1",
+        'bbhb2' => "-bbhb=2 -bbp=2",
+        'bbhb3' => "-bbhb=3 -bbp=3",
+        'bbhb4' => "-bbhb=3 -bbp=3 -bbhbi=2 -bbpi=2",
+        'bbhb5' => "-bbhb=3 -bbp=3 -bbhbi=1 -bbpi=1",
+        'boa'   => <<'----------',
+# -boa is default so we test nboa
+-nboa
+----------
         'braces7' => <<'----------',
 -bli -blil='*'
 ----------
@@ -70,6 +75,14 @@ yarg => 'yarp',
 }, );
 ----------
 
+        'boa' => <<'----------',
+my @field
+  : field
+  : Default(1)
+  : Get('Name' => 'foo') 
+  : Set('Name');
+----------
+
         'braces' => <<'----------',
 sub message {
     if ( !defined( $_[0] ) ) {
@@ -691,6 +704,14 @@ my $hlist = $control::control->Scrolled(
 
 #18...........
         },
+
+        'boa.boa' => {
+            source => "boa",
+            params => "boa",
+            expect => <<'#19...........',
+my @field : field : Default(1) : Get('Name' => 'foo') : Set('Name');
+#19...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};
diff --git a/t/snippets23.t b/t/snippets23.t
new file mode 100644
index 00000000..dd829fd6
--- /dev/null
+++ b/t/snippets23.t
@@ -0,0 +1,277 @@
+# Created with: ./make_t.pl
+
+# Contents:
+#1 boa.def
+#2 bol.bol
+#3 bol.def
+#4 bot.bot
+#5 bot.def
+#6 hash_bang.def
+#7 hash_bang.hash_bang
+#8 listop1.listop1
+#9 sbcp.def
+#10 sbcp.sbcp1
+
+# To locate test #13 you can search for its name or the string '#13'
+
+use strict;
+use Test::More;
+use Carp;
+use Perl::Tidy;
+my $rparams;
+my $rsources;
+my $rtests;
+
+BEGIN {
+
+    ###########################################
+    # BEGIN SECTION 1: Parameter combinations #
+    ###########################################
+    $rparams = {
+        'bol' => <<'----------',
+# -bol is default, so test -nbol
+-nbol
+----------
+        'bot' => <<'----------',
+# -bot is default so we test -nbot
+-nbot
+----------
+        'def'       => "",
+        'hash_bang' => "-x",
+        'listop1'   => <<'----------',
+# -bok is default so we test nbok
+-nbok
+----------
+        'sbcp1' => <<'----------',
+-sbc -sbcp='#x#'
+----------
+    };
+
+    ############################
+    # BEGIN SECTION 2: Sources #
+    ############################
+    $rsources = {
+
+        'boa' => <<'----------',
+my @field
+  : field
+  : Default(1)
+  : Get('Name' => 'foo') 
+  : Set('Name');
+----------
+
+        'bol' => <<'----------',
+return unless $cmd = $cmd || ($dot 
+          && $Last_Shell) || &prompt('|');
+----------
+
+        'bot' => <<'----------',
+$foo =
+  $condition
+  ? undef
+  : 1;
+----------
+
+        'hash_bang' => <<'----------',
+
+
+
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
+----------
+
+        'listop1' => <<'----------',
+my @sorted = map { $_->[0] }
+  sort { $a->[1] <=> $b->[1] }
+  map { [ $_, rand ] } @list;
+----------
+
+        'sbcp' => <<'----------',
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+#x# 'Dec', 'Nov'
+## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
+----------
+    };
+
+    ####################################
+    # BEGIN SECTION 3: Expected output #
+    ####################################
+    $rtests = {
+
+        'boa.def' => {
+            source => "boa",
+            params => "def",
+            expect => <<'#1...........',
+my @field
+  : field
+  : Default(1)
+  : Get('Name' => 'foo')
+  : Set('Name');
+#1...........
+        },
+
+        'bol.bol' => {
+            source => "bol",
+            params => "bol",
+            expect => <<'#2...........',
+return unless $cmd = $cmd || ( $dot && $Last_Shell ) || &prompt('|');
+#2...........
+        },
+
+        'bol.def' => {
+            source => "bol",
+            params => "def",
+            expect => <<'#3...........',
+return
+  unless $cmd = $cmd
+  || ( $dot
+    && $Last_Shell )
+  || &prompt('|');
+#3...........
+        },
+
+        'bot.bot' => {
+            source => "bot",
+            params => "bot",
+            expect => <<'#4...........',
+$foo = $condition ? undef : 1;
+#4...........
+        },
+
+        'bot.def' => {
+            source => "bot",
+            params => "def",
+            expect => <<'#5...........',
+$foo =
+  $condition
+  ? undef
+  : 1;
+#5...........
+        },
+
+        'hash_bang.def' => {
+            source => "hash_bang",
+            params => "def",
+            expect => <<'#6...........',
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
+#6...........
+        },
+
+        'hash_bang.hash_bang' => {
+            source => "hash_bang",
+            params => "hash_bang",
+            expect => <<'#7...........',
+
+
+
+
+# above spaces will be retained with -x but not by default
+#!/usr/bin/perl
+my $date = localtime();
+#7...........
+        },
+
+        'listop1.listop1' => {
+            source => "listop1",
+            params => "listop1",
+            expect => <<'#8...........',
+my @sorted =
+  map { $_->[0] } sort { $a->[1] <=> $b->[1] } map { [ $_, rand ] } @list;
+#8...........
+        },
+
+        'sbcp.def' => {
+            source => "sbcp",
+            params => "def",
+            expect => <<'#9...........',
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+
+    #x# 'Dec', 'Nov'
+## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
+#9...........
+        },
+
+        'sbcp.sbcp1' => {
+            source => "sbcp",
+            params => "sbcp1",
+            expect => <<'#10...........',
+@month_of_year = (
+    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct',
+#x# 'Dec', 'Nov'
+    ## 'Dec', 'Nov'
+    'Nov', 'Dec'
+);
+#10...........
+        },
+    };
+
+    my $ntests = 0 + keys %{$rtests};
+    plan tests => $ntests;
+}
+
+###############
+# EXECUTE TESTS
+###############
+
+foreach my $key ( sort keys %{$rtests} ) {
+    my $output;
+    my $sname  = $rtests->{$key}->{source};
+    my $expect = $rtests->{$key}->{expect};
+    my $pname  = $rtests->{$key}->{params};
+    my $source = $rsources->{$sname};
+    my $params = defined($pname) ? $rparams->{$pname} : "";
+    my $stderr_string;
+    my $errorfile_string;
+    my $err = Perl::Tidy::perltidy(
+        source      => \$source,
+        destination => \$output,
+        perltidyrc  => \$params,
+        argv        => '',             # for safety; hide any ARGV from perltidy
+        stderr      => \$stderr_string,
+        errorfile   => \$errorfile_string,    # not used when -se flag is set
+    );
+    if ( $err || $stderr_string || $errorfile_string ) {
+        print STDERR "Error output received for test '$key'\n";
+        if ($err) {
+            print STDERR "An error flag '$err' was returned\n";
+            ok( !$err );
+        }
+        if ($stderr_string) {
+            print STDERR "---------------------\n";
+            print STDERR "<>\n$stderr_string\n";
+            print STDERR "---------------------\n";
+            ok( !$stderr_string );
+        }
+        if ($errorfile_string) {
+            print STDERR "---------------------\n";
+            print STDERR "<<.ERR file>>\n$errorfile_string\n";
+            print STDERR "---------------------\n";
+            ok( !$errorfile_string );
+        }
+    }
+    else {
+        if ( !is( $output, $expect, $key ) ) {
+            my $leno = length($output);
+            my $lene = length($expect);
+            if ( $leno == $lene ) {
+                print STDERR
+"#> Test '$key' gave unexpected output.  Strings differ but both have length $leno\n";
+            }
+            else {
+                print STDERR
+"#> Test '$key' gave unexpected output.  String lengths differ: output=$leno, expected=$lene\n";
+            }
+        }
+    }
+}
-- 
2.39.5