From 03829b2c8fafe0c83a2629afddc98bb7c2bd98aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20J=C3=B6rg?= Date: Mon, 5 Oct 2020 12:36:56 +0200 Subject: ; cperl-mode: Fix a test to ensure cperl-mode is active Tweaking my commit 2020-09-04 "Fix infloop when indenting in cperl-mode": * 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. --- test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl | 4 ++-- test/lisp/progmodes/cperl-mode-tests.el | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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 4a9842ffa5..8c1883a10f 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 @@ } continue { -last; # no endless loop, though +last; } } # -------- while loop: expected output -------- @@ -34,7 +34,7 @@ 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 f0ff8e9005..20be7ed68c 100644 --- a/test/lisp/progmodes/cperl-mode-tests.el +++ b/test/lisp/progmodes/cperl-mode-tests.el @@ -148,6 +148,7 @@ cperl-mode-test-indent-exp 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 @@ cperl-mode-test-indent-exp 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)) -- 2.20.1