]> git.donarmstrong.com Git - perltidy.git/commitdiff
added test cases
authorSteve Hancock <perltidy@users.sourceforge.net>
Sat, 25 Apr 2020 14:41:24 +0000 (07:41 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sat, 25 Apr 2020 14:41:24 +0000 (07:41 -0700)
14 files changed:
t/snippets/comments1.par
t/snippets/comments2.par
t/snippets/comments3.par
t/snippets/comments4.par
t/snippets/comments5.par
t/snippets/coverage_values.txt
t/snippets/expect/maths.maths3 [new file with mode: 0644]
t/snippets/maths1.par
t/snippets/maths2.par
t/snippets/maths3.par [new file with mode: 0644]
t/snippets/packing_list.txt
t/snippets17.t
t/snippets18.t
t/snippets19.t

index ceb3c03864e837609ddeb27f516177dea4cd6f29..b093922ba52c50e62d7caf152aaff3839f4ba6a4 100644 (file)
@@ -1 +1,6 @@
+# testing --fixed-position-side-comment=40, 
+# --ignore-side-comment-lengths,
+# --noindent-block-comments,
+# --nohanging-side-comments
+# --static-side-comments
 -fpsc=40 -iscl -nibc -nhsc -ssc
index bf263e5b3cf47a706fe2cf851b8c4e36324c75ff..0f8ff5a4add04faa90616f227f14b0fa4ef07676 100644 (file)
@@ -1 +1,2 @@
+# testing --minimum-space-to-comment=10, --delete-block-comments, --delete-pod
 -msc=10 -dbc -dp
index 4b5f9142c3447dbf4430e1a0efbf0e1306c17fd6..31726c69c575a3f7fc9e123d99633793d9744f8c 100644 (file)
@@ -1 +1,2 @@
+# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments
 -mbl=2 -isbc
index ce467f5c7af27bcb5afc4931db50ed9600c853f8..a209e3055a3aacd810e0885764fc14044a746446 100644 (file)
@@ -1 +1,4 @@
+# testing --keep-old-blank-lines=2 [=all] and 
+# --nooutdent-long-comments and 
+# --outdent-static-block-comments
 -kbl=2 -nolc -osbc
index 1fa4c457e14b50d36b8b8489df01e9704a619bf5..a51038b1e4d19ee6edad7eb9cf87287e40ebb6fe 100644 (file)
@@ -1 +1,2 @@
+# testing --delete-side-comments and --nostatic-block-comments
 -dsc -nsbc
index b907f75c49f3cd13bf9443b402337ab6becb858f..a86420eb208d718e496c01b5f0ca6c6ff2446a34 100644 (file)
 $VAR1 = {
-          'line-up-parentheses' => [
-                                     0,
-                                     1
-                                   ],
-          'nowant-left-space' => [
-                                   '++ -- ?',
-                                   '..',
-                                   '= + - / *'
-                                 ],
-          'backup-file-extension' => [
-                                       'bak',
-                                       '~'
+          'sub-alias-list' => [
+                                'method fun'
+                              ],
+          'space-function-paren' => [
+                                      0,
+                                      1
+                                    ],
+          'delete-pod' => [
+                            0,
+                            1
+                          ],
+          'blank-lines-before-closing-block' => [
+                                                  1
+                                                ],
+          'delete-block-comments' => [
+                                       0,
+                                       1
                                      ],
-          'closing-side-comments-balanced' => [
-                                                0,
-                                                1
+          'square-bracket-tightness' => [
+                                          0,
+                                          1,
+                                          2
+                                        ],
+          'closing-side-comment-else-flag' => [
+                                                0
                                               ],
-          'break-after-all-operators' => [
-                                           0,
-                                           1
-                                         ],
-          'want-break-before' => [
-                                   ' ',
-                                   '% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=',
-                                   '% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=',
-                                   '='
-                                 ],
           'one-line-block-nesting' => [
                                         0,
                                         1
                                       ],
-          'fixed-position-side-comment' => [
-                                             40
-                                           ],
-          'delete-closing-side-comments' => [
-                                              0,
-                                              1
-                                            ],
-          'closing-side-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'break-before-all-operators' => [
-                                            0,
-                                            1
-                                          ],
+          'indent-closing-brace' => [
+                                      0,
+                                      1
+                                    ],
           'blanks-before-blocks' => [
                                       0,
                                       1
                                     ],
-          'space-prototype-paren' => [
-                                       0,
-                                       1,
-                                       2
-                                     ],
-          'opening-sub-brace-on-new-line' => [
-                                               0,
-                                               1
-                                             ],
-          'closing-paren-indentation' => [
-                                           0,
-                                           1,
-                                           2
-                                         ],
+          'break-before-all-operators' => [
+                                            0,
+                                            1
+                                          ],
+          'want-left-space' => [
+                                 '+ -',
+                                 '= .= =~ !~ :'
+                               ],
+          'closing-side-comments-balanced' => [
+                                                0,
+                                                1
+                                              ],
           'square-bracket-vertical-tightness-closing' => [
                                                            0,
                                                            2
                                                          ],
-          'indent-spaced-block-comments' => [
-                                              0,
-                                              1
-                                            ],
-          'want-right-space' => [
-                                  '= .= =~ !~ ? :'
-                                ],
-          'timestamp' => [
-                           0,
-                           1
-                         ],
-          'blank-lines-before-packages' => [
-                                             0,
-                                             1
-                                           ],
-          'closing-side-comment-maximum-text' => [
-                                                   20,
-                                                   40
-                                                 ],
-          'stack-closing-block-brace' => [
-                                           0,
-                                           1
-                                         ],
-          'one-line-block-semicolons' => [
-                                           0,
-                                           1,
-                                           2
-                                         ],
-          'break-at-old-method-breakpoints' => [
-                                                 0,
-                                                 1
+          'short-concatenation-item-length' => [
+                                                 12,
+                                                 8
                                                ],
-          'entab-leading-whitespace' => [
-                                          8
+          'space-terminal-semicolon' => [
+                                          0,
+                                          1
                                         ],
-          'space-backslash-quote' => [
+          'delete-semicolons' => [
+                                   0,
+                                   1
+                                 ],
+          'keyword-group-blanks-size' => [
+                                           '5'
+                                         ],
+          'iterations' => [
+                            1
+                          ],
+          'outdent-long-quotes' => [
+                                     0,
+                                     1
+                                   ],
+          'block-brace-vertical-tightness' => [
+                                                0,
+                                                1
+                                              ],
+          'stack-closing-paren' => [
+                                     0,
+                                     1
+                                   ],
+          'default-tabsize' => [
+                                 8
+                               ],
+          'closing-side-comments' => [
                                        0,
-                                       1,
-                                       2
+                                       1
                                      ],
-          'static-block-comments' => [
+          'delete-old-whitespace' => [
                                        0,
                                        1
                                      ],
-          'space-after-keyword' => [
-                                     'push'
-                                   ],
-          'nowant-right-space' => [
-                                    '++ --',
-                                    '..',
-                                    '= + - / *',
-                                    'A'
-                                  ],
-          'nospace-after-keyword' => [
-                                       'my for'
+          'keyword-group-blanks-before' => [
+                                             1,
+                                             2
+                                           ],
+          'space-backslash-quote' => [
+                                       0,
+                                       1,
+                                       2
                                      ],
+          'cuddled-break-option' => [
+                                      1
+                                    ],
           'closing-square-bracket-indentation' => [
                                                     0,
                                                     1,
                                                     2
                                                   ],
-          'long-block-line-count' => [
-                                       8
-                                     ],
-          'iterations' => [
-                            1
-                          ],
-          'blank-lines-before-closing-block' => [
-                                                  1
-                                                ],
+          'keyword-group-blanks-inside' => [
+                                             0,
+                                             1
+                                           ],
+          'paren-vertical-tightness' => [
+                                          0,
+                                          1,
+                                          2
+                                        ],
+          'brace-tightness' => [
+                                 0,
+                                 1,
+                                 2
+                               ],
+          'delete-closing-side-comments' => [
+                                              0,
+                                              1
+                                            ],
           'format' => [
                         'html',
                         'tidy'
                       ],
-          'brace-left-and-indent' => [
+          'space-for-semicolon' => [
+                                     0,
+                                     1
+                                   ],
+          'nospace-after-keyword' => [
+                                       'my for'
+                                     ],
+          'standard-error-output' => [
                                        0,
                                        1
                                      ],
@@ -149,10 +148,40 @@ $VAR1 = {
                                            0,
                                            1
                                          ],
-          'outdent-keywords' => [
-                                  0,
-                                  1
-                                ],
+          'ignore-side-comment-lengths' => [
+                                             0,
+                                             1
+                                           ],
+          'static-block-comments' => [
+                                       0,
+                                       1
+                                     ],
+          'square-bracket-vertical-tightness' => [
+                                                   0,
+                                                   1,
+                                                   2
+                                                 ],
+          'want-break-before' => [
+                                   ' ',
+                                   '% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x=',
+                                   '% + - * / x != == >= <= =~ < > | & **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x=',
+                                   '='
+                                 ],
+          'block-brace-tightness' => [
+                                       0,
+                                       1,
+                                       2
+                                     ],
+          'brace-left-and-indent-list' => [
+                                            'if'
+                                          ],
+          'closing-side-comment-maximum-text' => [
+                                                   20,
+                                                   40
+                                                 ],
+          'entab-leading-whitespace' => [
+                                          8
+                                        ],
           'break-at-old-semicolon-breakpoints' => [
                                                     0,
                                                     1
@@ -161,328 +190,316 @@ $VAR1 = {
                                      0,
                                      1
                                    ],
-          'default-tabsize' => [
-                                 8
-                               ],
-          'square-bracket-vertical-tightness' => [
-                                                   0,
-                                                   1,
-                                                   2
-                                                 ],
-          'closing-side-comment-else-flag' => [
-                                                0
-                                              ],
-          'outdent-static-block-comments' => [
-                                               0,
-                                               1
-                                             ],
-          'stack-closing-square-bracket' => [
-                                              0,
-                                              1
-                                            ],
-          'delete-pod' => [
-                            0,
-                            1
-                          ],
-          'opening-hash-brace-right' => [
-                                          0,
-                                          1
-                                        ],
           'closing-side-comment-interval' => [
                                                2,
                                                20,
                                                6
                                              ],
-          'delete-old-newlines' => [
-                                     0,
-                                     1
-                                   ],
-          'delete-block-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'keyword-group-blanks-size' => [
-                                           '5'
-                                         ],
-          'outdent-labels' => [
+          'indent-columns' => [
                                 0,
-                                1
+                                2,
+                                4
                               ],
-          'keyword-group-blanks-delete' => [
-                                             0,
-                                             1
-                                           ],
-          'keep-old-blank-lines' => [
-                                      0,
-                                      1,
-                                      2
-                                    ],
-          'brace-tightness' => [
-                                 0,
-                                 1,
-                                 2
-                               ],
-          'cuddled-else' => [
+          'variable-maximum-line-length' => [
+                                              0,
+                                              1
+                                            ],
+          'add-newlines' => [
                               0,
                               1
                             ],
-          'hanging-side-comments' => [
-                                       0,
-                                       1
-                                     ],
-          'blank-lines-after-opening-block-list' => [
-                                                      '*'
-                                                    ],
-          'sub-alias-list' => [
-                                'method fun'
-                              ],
-          'comma-arrow-breakpoints' => [
-                                         1,
-                                         5
-                                       ],
-          'cuddled-break-option' => [
-                                      1
-                                    ],
-          'continuation-indentation' => [
+          'stack-opening-hash-brace' => [
                                           0,
-                                          2,
-                                          4
+                                          1
                                         ],
-          'brace-vertical-tightness-closing' => [
-                                                  0,
-                                                  2
-                                                ],
-          'want-break-after' => [
-                                  '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||'
-                                ],
-          'backup-and-modify-in-place' => [
-                                            0,
-                                            1
-                                          ],
-          'add-semicolons' => [
+          'add-whitespace' => [
                                 0,
                                 1
                               ],
-          'keyword-group-blanks-before' => [
-                                             1,
-                                             2
-                                           ],
-          'standard-error-output' => [
-                                       0,
-                                       1
-                                     ],
-          'opening-square-bracket-right' => [
+          'stack-closing-square-bracket' => [
                                               0,
                                               1
                                             ],
-          'add-whitespace' => [
-                                0,
-                                1
-                              ],
-          'stack-opening-paren' => [
-                                     0,
-                                     1
-                                   ],
+          'comma-arrow-breakpoints' => [
+                                         1,
+                                         5
+                                       ],
+          'keyword-group-blanks-repeat-count' => [
+                                                   0
+                                                 ],
+          'closing-brace-indentation' => [
+                                           0,
+                                           1,
+                                           2
+                                         ],
+          'nowant-right-space' => [
+                                    '+ -',
+                                    '++ --',
+                                    '..',
+                                    '= + - / *',
+                                    'A'
+                                  ],
           'delete-side-comments' => [
                                       0,
                                       1
                                     ],
-          'keyword-group-blanks-inside' => [
+          'long-block-line-count' => [
+                                       8
+                                     ],
+          'keyword-group-blanks-delete' => [
                                              0,
                                              1
                                            ],
-          'warning-output' => [
-                                0,
-                                1
-                              ],
-          'want-left-space' => [
-                                 '= .= =~ !~ :'
-                               ],
-          'maximum-fields-per-table' => [
-                                          0
+          'tight-secret-operators' => [
+                                        0,
+                                        1
+                                      ],
+          'continuation-indentation' => [
+                                          0,
+                                          2,
+                                          4
                                         ],
-          'indent-block-comments' => [
+          'brace-left-and-indent' => [
                                        0,
                                        1
                                      ],
-          'weld-nested-containers' => [
-                                        0,
-                                        1
-                                      ],
-          'block-brace-vertical-tightness' => [
-                                                0,
-                                                1
-                                              ],
-          'static-side-comments' => [
-                                      0,
-                                      1
-                                    ],
-          'ignore-old-breakpoints' => [
-                                        0,
-                                        1
-                                      ],
-          'short-concatenation-item-length' => [
-                                                 12,
-                                                 8
-                                               ],
-          'space-for-semicolon' => [
+          'line-up-parentheses' => [
                                      0,
                                      1
                                    ],
-          'closing-brace-indentation' => [
-                                           0,
-                                           1,
-                                           2
-                                         ],
-          'blank-lines-after-opening-block' => [
-                                                 2
-                                               ],
-          'opening-brace-always-on-right' => [
+          'opening-sub-brace-on-new-line' => [
                                                0,
                                                1
                                              ],
-          'recombine' => [
-                           0,
-                           1
-                         ],
-          'indent-columns' => [
-                                0,
-                                2,
-                                4
-                              ],
           'opening-paren-right' => [
                                      0,
                                      1
                                    ],
-          'stack-closing-paren' => [
+          'opening-anonymous-sub-brace-on-new-line' => [
+                                                         0,
+                                                         1
+                                                       ],
+          'want-right-space' => [
+                                  '= .= =~ !~ ? :',
+                                  '= / *'
+                                ],
+          'delete-old-newlines' => [
                                      0,
                                      1
                                    ],
-          'paren-tightness' => [
-                                 0,
-                                 1,
-                                 2
-                               ],
-          'variable-maximum-line-length' => [
-                                              0,
-                                              1
-                                            ],
-          'brace-vertical-tightness' => [
+          'stack-closing-hash-brace' => [
                                           0,
-                                          1,
-                                          2
+                                          1
                                         ],
-          'break-at-old-comma-breakpoints' => [
-                                                0,
-                                                1
-                                              ],
+          'starting-indentation-level' => [
+                                            0
+                                          ],
+          'backup-and-modify-in-place' => [
+                                            0,
+                                            1
+                                          ],
+          'perl-syntax-check-flags' => [
+                                         '-c -T'
+                                       ],
+          'keep-interior-semicolons' => [
+                                          0,
+                                          1
+                                        ],
+          'stack-opening-square-bracket' => [
+                                              0,
+                                              1
+                                            ],
+          'outdent-long-comments' => [
+                                       0,
+                                       1
+                                     ],
+          'blank-lines-after-opening-block' => [
+                                                 2
+                                               ],
+          'add-semicolons' => [
+                                0,
+                                1
+                              ],
+          'indent-block-comments' => [
+                                       0,
+                                       1
+                                     ],
+          'break-after-all-operators' => [
+                                           0,
+                                           1
+                                         ],
           'character-encoding' => [
                                     'guess'
                                   ],
+          'timestamp' => [
+                           0,
+                           1
+                         ],
+          'fixed-position-side-comment' => [
+                                             40
+                                           ],
+          'one-line-block-semicolons' => [
+                                           0,
+                                           1,
+                                           2
+                                         ],
           'fuzzy-line-length' => [
                                    0,
                                    1
                                  ],
-          'blank-lines-before-closing-block-list' => [
-                                                       '*'
-                                                     ],
-          'check-syntax' => [
-                              0,
-                              1
-                            ],
-          'stack-closing-hash-brace' => [
-                                          0,
-                                          1
-                                        ],
+          'brace-vertical-tightness-closing' => [
+                                                  0,
+                                                  2
+                                                ],
+          'blank-lines-before-subs' => [
+                                         0,
+                                         1
+                                       ],
           'cuddled-block-list' => [
                                     'map,sort,grep',
                                     'sort,map,grep'
                                   ],
-          'square-bracket-tightness' => [
-                                          0,
-                                          1,
-                                          2
-                                        ],
-          'block-brace-tightness' => [
-                                       0,
-                                       1,
-                                       2
+          'opening-brace-always-on-right' => [
+                                               0,
+                                               1
+                                             ],
+          'indent-spaced-block-comments' => [
+                                              0,
+                                              1
+                                            ],
+          'recombine' => [
+                           0,
+                           1
+                         ],
+          'backup-file-extension' => [
+                                       'bak',
+                                       '~'
                                      ],
-          'add-newlines' => [
+          'check-syntax' => [
                               0,
                               1
                             ],
-          'space-terminal-semicolon' => [
-                                          0,
-                                          1
-                                        ],
-          'ignore-side-comment-lengths' => [
-                                             0,
-                                             1
-                                           ],
-          'brace-left-and-indent-list' => [
-                                            'if'
-                                          ],
-          'tight-secret-operators' => [
+          'ignore-old-breakpoints' => [
                                         0,
                                         1
                                       ],
-          'space-function-paren' => [
+          'static-side-comments' => [
                                       0,
                                       1
                                     ],
+          'minimum-space-to-comment' => [
+                                          10,
+                                          2,
+                                          4
+                                        ],
           'keyword-group-blanks-after' => [
                                             1,
                                             2
                                           ],
-          'stack-opening-hash-brace' => [
+          'cuddled-else' => [
+                              0,
+                              1
+                            ],
+          'space-after-keyword' => [
+                                     'push'
+                                   ],
+          'paren-tightness' => [
+                                 0,
+                                 1,
+                                 2
+                               ],
+          'stack-opening-paren' => [
+                                     0,
+                                     1
+                                   ],
+          'want-break-after' => [
+                                  '% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x= . << >> -> && ||'
+                                ],
+          'brace-vertical-tightness' => [
                                           0,
-                                          1
+                                          1,
+                                          2
                                         ],
-          'starting-indentation-level' => [
-                                            0
-                                          ],
-          'delete-old-whitespace' => [
+          'space-prototype-paren' => [
                                        0,
-                                       1
+                                       1,
+                                       2
                                      ],
-          'maximum-consecutive-blank-lines' => [
-                                                 0,
-                                                 1,
-                                                 2
-                                               ],
-          'outdent-long-quotes' => [
-                                     0,
-                                     1
-                                   ],
-          'blanks-before-comments' => [
+          'weld-nested-containers' => [
                                         0,
                                         1
                                       ],
-          'outdent-long-comments' => [
+          'opening-square-bracket-right' => [
+                                              0,
+                                              1
+                                            ],
+          'closing-paren-indentation' => [
+                                           0,
+                                           1,
+                                           2
+                                         ],
+          'warning-output' => [
+                                0,
+                                1
+                              ],
+          'paren-vertical-tightness-closing' => [
+                                                  0,
+                                                  2
+                                                ],
+          'blank-lines-before-closing-block-list' => [
+                                                       '*'
+                                                     ],
+          'outdent-static-block-comments' => [
+                                               0,
+                                               1
+                                             ],
+          'nowant-left-space' => [
+                                   '++ -- ?',
+                                   '..',
+                                   '= + - / *',
+                                   '= / *'
+                                 ],
+          'hanging-side-comments' => [
                                        0,
                                        1
                                      ],
-          'paren-vertical-tightness' => [
+          'break-at-old-method-breakpoints' => [
+                                                 0,
+                                                 1
+                                               ],
+          'maximum-consecutive-blank-lines' => [
+                                                 0,
+                                                 1,
+                                                 2
+                                               ],
+          'keep-old-blank-lines' => [
+                                      0,
+                                      1,
+                                      2
+                                    ],
+          'opening-hash-brace-right' => [
                                           0,
-                                          1,
-                                          2
+                                          1
                                         ],
-          'opening-anonymous-sub-brace-on-new-line' => [
-                                                         0,
-                                                         1
-                                                       ],
-          'keyword-group-blanks-repeat-count' => [
-                                                   0
-                                                 ],
-          'delete-semicolons' => [
-                                   0,
-                                   1
-                                 ],
-          'paren-vertical-tightness-closing' => [
-                                                  0,
-                                                  2
-                                                ],
+          'outdent-labels' => [
+                                0,
+                                1
+                              ],
+          'maximum-fields-per-table' => [
+                                          0
+                                        ],
+          'break-at-old-comma-breakpoints' => [
+                                                0,
+                                                1
+                                              ],
+          'blank-lines-before-packages' => [
+                                             0,
+                                             1
+                                           ],
+          'outdent-keywords' => [
+                                  0,
+                                  1
+                                ],
           'maximum-line-length' => [
                                      0,
                                      1,
@@ -493,28 +510,15 @@ $VAR1 = {
                                      78,
                                      80
                                    ],
-          'perl-syntax-check-flags' => [
-                                         '-c -T'
-                                       ],
-          'indent-closing-brace' => [
-                                      0,
-                                      1
-                                    ],
-          'keep-interior-semicolons' => [
-                                          0,
-                                          1
-                                        ],
-          'minimum-space-to-comment' => [
-                                          10,
-                                          2,
-                                          4
-                                        ],
-          'blank-lines-before-subs' => [
-                                         0,
-                                         1
-                                       ],
-          'stack-opening-square-bracket' => [
-                                              0,
-                                              1
-                                            ]
+          'blanks-before-comments' => [
+                                        0,
+                                        1
+                                      ],
+          'stack-closing-block-brace' => [
+                                           0,
+                                           1
+                                         ],
+          'blank-lines-after-opening-block-list' => [
+                                                      '*'
+                                                    ]
         };
diff --git a/t/snippets/expect/maths.maths3 b/t/snippets/expect/maths.maths3
new file mode 100644 (file)
index 0000000..fe58e1c
--- /dev/null
@@ -0,0 +1,13 @@
+$tmp=
+  $day -32075 +
+  1461* ( $year +4800 -( 14 -$month )/ 12 )/ 4 +
+  367* ( $month -2 +( ( 14 -$month )/ 12 )* 12 )/ 12 -
+  3* ( ( $year +4900 -( 14 -$month )/ 12 )/ 100 )/ 4;
+
+return ( $r**$n )*
+  ( pi**( $n/ 2 ) )/
+  (
+    sqrt(pi)* factorial( 2* ( int( $n/ 2 ) ) +2 )/ factorial( int( $n/ 2 ) +1 )
+      / ( 4**( int( $n/ 2 ) +1 ) ) );
+
+$root= -$b +sqrt( $b* $b -4.* $a* $c )/ ( 2.* $a );
index 02ae2b550d7a1c8c44989e2f1bc8a54c7fd031f3..c793bb9a4f92d7591a9ac7a06f705a5b8f2fc993 100644 (file)
@@ -1 +1,2 @@
+# testing -break-before-all-operators and no spaces around math operators
 -bbao -nwls="= + - / *"  -nwrs="= + - / *"
index 7c8142fbfeb253dbb211837c54b457e1279c18f1..4f0bf2ce6528b320c770c9501a443d2c55dea2b1 100644 (file)
@@ -1 +1,2 @@
+# testing -break-after-all-operators and no spaces around math operators
 -baao -nwls="= + - / *"  -nwrs="= + - / *"
diff --git a/t/snippets/maths3.par b/t/snippets/maths3.par
new file mode 100644 (file)
index 0000000..6146d93
--- /dev/null
@@ -0,0 +1,2 @@
+# test some bizarre spacing around operators
+-nwls="= / *"  -wrs="= / *" -nwrs="+ -" -wls="+ -"
index d430b89bb1fe83c25c88398c50383a2eefc7548b..aff810f59af985b93715270d14152200188fedfb 100644 (file)
 ../snippets19.t        space_paren.space_paren1
 ../snippets19.t        space_paren.space_paren2
 ../snippets19.t        braces.braces5
+../snippets19.t        braces.braces6
 ../snippets2.t angle.def
 ../snippets2.t arrows1.def
 ../snippets2.t arrows2.def
 ../snippets9.t rt98902.def
 ../snippets9.t rt98902.rt98902
 ../snippets9.t rt99961.def
-../snippets19.t        braces.braces6
+../snippets19.t        maths.maths3
index ae38fd88167fa55e288756f484a829d8e3930bf4..108c0738fdafec641053a9a712ef53c8c4e2a7fe 100644 (file)
@@ -38,10 +38,28 @@ BEGIN {
     ###########################################
     $rparams = {
         'bos'       => "-bos",
-        'comments1' => "-fpsc=40 -iscl -nibc -nhsc -ssc",
-        'comments2' => "-msc=10 -dbc -dp",
-        'comments3' => "-mbl=2 -isbc",
-        'comments4' => "-kbl=2 -nolc -osbc",
+        'comments1' => <<'----------',
+# testing --fixed-position-side-comment=40, 
+# --ignore-side-comment-lengths,
+# --noindent-block-comments,
+# --nohanging-side-comments
+# --static-side-comments
+-fpsc=40 -iscl -nibc -nhsc -ssc
+----------
+        'comments2' => <<'----------',
+# testing --minimum-space-to-comment=10, --delete-block-comments, --delete-pod
+-msc=10 -dbc -dp
+----------
+        'comments3' => <<'----------',
+# testing --maximum-consecutive-blank-lines=2 and --indent-spaced-block-comments
+-mbl=2 -isbc
+----------
+        'comments4' => <<'----------',
+# testing --keep-old-blank-lines=2 [=all] and 
+# --nooutdent-long-comments and 
+# --outdent-static-block-comments
+-kbl=2 -nolc -osbc
+----------
         'def'       => "",
         'long_line' => "-l=0",
         'pbp'       => "-pbp -nst -nse",
index 6a4e28ca7c2351d19351b60f9e617c51f3971233..29984b65d9032e48877d2333966e4222c36ea00f 100644 (file)
@@ -40,16 +40,21 @@ BEGIN {
         'braces1'   => "-bl -asbl",
         'braces2'   => "-sbl",
         'braces3'   => "-bli -bbvt=1",
-        'comments5' => "-dsc -nsbc",
-        'csc1'      => "-csc -csci=2 -ncscb",
-        'csc2'      => "-dcsc",
-        'def'       => "",
-        'iob'       => "-iob",
-        'kis'       => "-kis",
-        'maths1'    => <<'----------',
+        'comments5' => <<'----------',
+# testing --delete-side-comments and --nostatic-block-comments
+-dsc -nsbc
+----------
+        'csc1'   => "-csc -csci=2 -ncscb",
+        'csc2'   => "-dcsc",
+        'def'    => "",
+        'iob'    => "-iob",
+        'kis'    => "-kis",
+        'maths1' => <<'----------',
+# testing -break-before-all-operators and no spaces around math operators
 -bbao -nwls="= + - / *"  -nwrs="= + - / *"
 ----------
         'maths2' => <<'----------',
+# testing -break-after-all-operators and no spaces around math operators
 -baao -nwls="= + - / *"  -nwrs="= + - / *"
 ----------
         'wn' => "-wn",
index ff871345dfe87e61a97df55aba29f8d3eb5cc925..5c8155879e1cf280e40f997842e73a6c4e7734ac 100644 (file)
@@ -19,6 +19,7 @@
 #16 space_paren.space_paren2
 #17 braces.braces5
 #18 braces.braces6
+#19 maths.maths3
 
 # To locate test #13 you can search for its name or the string '#13'
 
@@ -40,8 +41,12 @@ BEGIN {
         'braces5' => <<'----------',
 -bli -blil='if'
 ----------
-        'braces6'    => "-ce",
-        'def'        => "",
+        'braces6' => "-ce",
+        'def'     => "",
+        'maths3'  => <<'----------',
+# test some bizarre spacing around operators
+-nwls="= / *"  -wrs="= / *" -nwrs="+ -" -wls="+ -"
+----------
         'misc_tests' => <<'----------',
 -sts -ssc -sfs -nsak="my for" -ndsm
 ----------
@@ -80,6 +85,18 @@ sub message {
 $myfun = sub {
     print("Hello, World\n");
 };
+----------
+
+        'maths' => <<'----------',
+$tmp = $day - 32075 + 1461 * ( $year + 4800 - ( 14 - $month ) / 12 ) / 4 + 367
+* ( $month - 2 + ( ( 14 - $month ) / 12 ) * 12 ) / 12 - 3 * ( ( $year + 4900 -
+( 14 - $month ) / 12 ) / 100 ) / 4;
+
+return ( $r**$n ) * ( pi**( $n / 2 ) ) / ( sqrt(pi) * factorial( 2 * ( int( $n
+/ 2 ) ) + 2 ) / factorial( int( $n / 2 ) + 1 ) / ( 4**( int( $n / 2 ) + 1 ) )
+);
+
+$root=-$b+sqrt($b*$b-4.*$a*$c)/(2.*$a);
 ----------
 
         'misc_tests' => <<'----------',
@@ -380,6 +397,26 @@ $myfun = sub {
 };
 #18...........
         },
+
+        'maths.maths3' => {
+            source => "maths",
+            params => "maths3",
+            expect => <<'#19...........',
+$tmp=
+  $day -32075 +
+  1461* ( $year +4800 -( 14 -$month )/ 12 )/ 4 +
+  367* ( $month -2 +( ( 14 -$month )/ 12 )* 12 )/ 12 -
+  3* ( ( $year +4900 -( 14 -$month )/ 12 )/ 100 )/ 4;
+
+return ( $r**$n )*
+  ( pi**( $n/ 2 ) )/
+  (
+    sqrt(pi)* factorial( 2* ( int( $n/ 2 ) ) +2 )/ factorial( int( $n/ 2 ) +1 )
+      / ( 4**( int( $n/ 2 ) +1 ) ) );
+
+$root= -$b +sqrt( $b* $b -4.* $a* $c )/ ( 2.* $a );
+#19...........
+        },
     };
 
     my $ntests = 0 + keys %{$rtests};