From: Harald Jörg Date: Tue, 6 Oct 2020 01:39:55 +0000 (+0200) Subject: cperl-mode: Fix a test to ensure cperl-mode is active X-Git-Tag: emacs-28.0.90~5742 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a14321ff69eac17ec0a8f3ee9cb106c1ed512281;p=emacs.git cperl-mode: Fix a test to ensure cperl-mode is active * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-indent-exp): Make sure that cperl-mode is active for testing 'cperl-indent-exp', also skip this test under perl-mode. * test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl: Eliminate dependency on unrelated customizable variables (bug#10483). --- diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl index 4a9842ffa56..8c1883a10f1 100644 --- a/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl +++ b/test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl @@ -26,7 +26,7 @@ say "boring loop"; } continue { -last; # no endless loop, though +last; } } # -------- while loop: expected output -------- @@ -34,7 +34,7 @@ last; # no endless loop, though while (1) { say "boring loop"; } continue { - last; # no endless loop, though + last; } } # -------- while loop: end -------- diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el index f0ff8e90052..20be7ed68cc 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -148,6 +148,7 @@ under timeout control." These exercise some standard blocks and also the special treatment for Perl expressions where a closing paren isn't the end of the statement." + (skip-unless (eq cperl-test-mode #'cperl-mode)) (let ((file (expand-file-name "cperl-indent-exp.pl" cperl-mode-tests-data-directory))) (with-temp-buffer @@ -166,6 +167,7 @@ end of the statement." got) (with-temp-buffer (insert code) + (cperl-mode) (goto-char (point-min)) (cperl-indent-exp) ; here we go! (setq expected (concat "test case " name ":\n" expected))