diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl | 16 | ||||
| -rw-r--r-- | test/lisp/progmodes/cperl-mode-tests.el | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl new file mode 100644 index 00000000000..44d1e49bd36 --- /dev/null +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-74245.pl | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # This resource file can be run with cperl--run-testcases from | ||
| 2 | # cperl-tests.el and works with both perl-mode and cperl-mode. | ||
| 3 | |||
| 4 | # -------- signature where last parameter is ignored: input ------- | ||
| 5 | package P { | ||
| 6 | use v5.36; | ||
| 7 | sub ignore ($first, $) {} | ||
| 8 | ignore(qw(first second)); | ||
| 9 | } | ||
| 10 | # -------- signature where last parameter is ignored: expected output ------- | ||
| 11 | package P { | ||
| 12 | use v5.36; | ||
| 13 | sub ignore ($first, $) {} | ||
| 14 | ignore(qw(first second)); | ||
| 15 | } | ||
| 16 | # -------- signature where last parameter is ignored: end ------- | ||
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index 958ffe38a8b..e54790256ab 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el | |||
| @@ -1589,6 +1589,15 @@ and the slash, then we have a division." | |||
| 1589 | (should (equal (nth 8 (cperl-test-ppss code "/")) 9))) | 1589 | (should (equal (nth 8 (cperl-test-ppss code "/")) 9))) |
| 1590 | ) | 1590 | ) |
| 1591 | 1591 | ||
| 1592 | (ert-deftest cperl-test-bug-74245 () | ||
| 1593 | "Verify that a bare \"$\" can appear at the end of a subroutine signature. | ||
| 1594 | It must not be mistaken for \"$)\"." | ||
| 1595 | (cperl--run-test-cases | ||
| 1596 | (ert-resource-file "cperl-bug-74245.pl") | ||
| 1597 | (while (null (eobp)) | ||
| 1598 | (cperl-indent-command) | ||
| 1599 | (forward-line 1)))) | ||
| 1600 | |||
| 1592 | (ert-deftest test-indentation () | 1601 | (ert-deftest test-indentation () |
| 1593 | (ert-test-erts-file (ert-resource-file "cperl-indents.erts"))) | 1602 | (ert-test-erts-file (ert-resource-file "cperl-indents.erts"))) |
| 1594 | 1603 | ||