diff options
| author | Harald Jörg | 2024-01-09 18:46:41 +0100 |
|---|---|---|
| committer | Harald Jörg | 2024-01-09 19:14:56 +0100 |
| commit | fccaeabc959f5403ce49744030bd2620352b59f8 (patch) | |
| tree | 991c235a890f08d76bf65683e9a34ceca1c39ad9 | |
| parent | aff1d53cd466b64ded08d5cf12f83e5746704c07 (diff) | |
| download | emacs-fccaeabc959f5403ce49744030bd2620352b59f8.tar.gz emacs-fccaeabc959f5403ce49744030bd2620352b59f8.zip | |
; cperl-mode-tests.el: Adapt to recent changes in cperl-mode.el
The tests need to use the new command cperl-file-style to make
sure that settings don't bleed out to following tests.
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-indent-styles, cperl-test-bug-35925)
(cperl-test-bug-64364, cperl-test-bug-65834): use cperl-file-style
instead of cperl-set-style
| -rw-r--r-- | test/lisp/progmodes/cperl-mode-tests.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index e3026dbfb5a..62b7fdab7f7 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el | |||
| @@ -111,9 +111,8 @@ end of the statement." | |||
| 111 | (skip-unless (eq cperl-test-mode #'cperl-mode)) | 111 | (skip-unless (eq cperl-test-mode #'cperl-mode)) |
| 112 | (cperl--run-test-cases | 112 | (cperl--run-test-cases |
| 113 | (ert-resource-file "cperl-indent-styles.pl") | 113 | (ert-resource-file "cperl-indent-styles.pl") |
| 114 | (cperl-set-style "PBP") | 114 | (cperl-file-style "PBP") |
| 115 | (indent-region (point-min) (point-max)) ; here we go! | 115 | (indent-region (point-min) (point-max)))) ; here we go! |
| 116 | (cperl-set-style-back))) | ||
| 117 | 116 | ||
| 118 | ;;; Fontification tests | 117 | ;;; Fontification tests |
| 119 | 118 | ||
| @@ -1145,17 +1144,16 @@ Perl is not Lisp: An open paren in column 0 does not start a function." | |||
| 1145 | 1144 | ||
| 1146 | (ert-deftest cperl-test-bug-35925 () | 1145 | (ert-deftest cperl-test-bug-35925 () |
| 1147 | "Check that indentation is correct after a terminating format declaration." | 1146 | "Check that indentation is correct after a terminating format declaration." |
| 1148 | (cperl-set-style "PBP") ; Make cperl-mode use the same settings as perl-mode. | ||
| 1149 | (cperl--run-test-cases | 1147 | (cperl--run-test-cases |
| 1150 | (ert-resource-file "cperl-bug-35925.pl") | 1148 | (ert-resource-file "cperl-bug-35925.pl") |
| 1149 | (cperl-file-style "PBP") ; Make cperl-mode use the same settings as perl-mode. | ||
| 1151 | (let ((tab-function | 1150 | (let ((tab-function |
| 1152 | (if (equal cperl-test-mode 'perl-mode) | 1151 | (if (equal cperl-test-mode 'perl-mode) |
| 1153 | #'indent-for-tab-command | 1152 | #'indent-for-tab-command |
| 1154 | #'cperl-indent-command))) | 1153 | #'cperl-indent-command))) |
| 1155 | (goto-char (point-max)) | 1154 | (goto-char (point-max)) |
| 1156 | (forward-line -2) | 1155 | (forward-line -2) |
| 1157 | (funcall tab-function))) | 1156 | (funcall tab-function)))) |
| 1158 | (cperl-set-style-back)) | ||
| 1159 | 1157 | ||
| 1160 | (ert-deftest cperl-test-bug-37127 () | 1158 | (ert-deftest cperl-test-bug-37127 () |
| 1161 | "Verify that closing a paren in a regex goes without a message. | 1159 | "Verify that closing a paren in a regex goes without a message. |
| @@ -1363,12 +1361,13 @@ as a regex." | |||
| 1363 | 1361 | ||
| 1364 | (ert-deftest cperl-test-bug-64364 () | 1362 | (ert-deftest cperl-test-bug-64364 () |
| 1365 | "Check that multi-line subroutine declarations indent correctly." | 1363 | "Check that multi-line subroutine declarations indent correctly." |
| 1366 | (cperl-set-style "PBP") ; make cperl-mode use the same settings as perl-mode | ||
| 1367 | (cperl--run-test-cases | 1364 | (cperl--run-test-cases |
| 1368 | (ert-resource-file "cperl-bug-64364.pl") | 1365 | (ert-resource-file "cperl-bug-64364.pl") |
| 1366 | (cperl-file-style "PBP") ; make cperl-mode use the same settings as perl-mode | ||
| 1369 | (indent-region (point-min) (point-max))) | 1367 | (indent-region (point-min) (point-max))) |
| 1370 | (cperl--run-test-cases | 1368 | (cperl--run-test-cases |
| 1371 | (ert-resource-file "cperl-bug-64364.pl") | 1369 | (ert-resource-file "cperl-bug-64364.pl") |
| 1370 | (cperl-file-style "PBP") ; make cperl-mode use the same settings as perl-mode | ||
| 1372 | (let ((tab-function | 1371 | (let ((tab-function |
| 1373 | (if (equal cperl-test-mode 'perl-mode) | 1372 | (if (equal cperl-test-mode 'perl-mode) |
| 1374 | #'indent-for-tab-command | 1373 | #'indent-for-tab-command |
| @@ -1376,8 +1375,7 @@ as a regex." | |||
| 1376 | (goto-char (point-min)) | 1375 | (goto-char (point-min)) |
| 1377 | (while (null (eobp)) | 1376 | (while (null (eobp)) |
| 1378 | (funcall tab-function) | 1377 | (funcall tab-function) |
| 1379 | (forward-line 1)))) | 1378 | (forward-line 1))))) |
| 1380 | (cperl-set-style-back)) | ||
| 1381 | 1379 | ||
| 1382 | (ert-deftest cperl-test-bug-65834 () | 1380 | (ert-deftest cperl-test-bug-65834 () |
| 1383 | "Verify that CPerl mode identifies a left-shift operator. | 1381 | "Verify that CPerl mode identifies a left-shift operator. |