summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2021-11-07 21:20:15 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-07 21:20:15 +0100
commit86fc154317c605a4f6434694d8e754446d37b733 (patch)
treec9a952e4cc280b6b19e7d3f4888e06c0f07e4672
parent764341919fc576ca2564b0529ca375d9827a3ea2 (diff)
downloademacs-86fc154317c605a4f6434694d8e754446d37b733.tar.gz
Fix intermittent electric test failures
* test/lisp/electric-tests.el (whitespace-chomping-dont-cross-comments): Move 'c-toggle-comment-style' to here.: (bug#51665).
-rw-r--r--test/lisp/electric-tests.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 686641c1b33..1e32dbfb609 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -32,9 +32,6 @@
(require 'elec-pair)
(require 'cl-lib)
-;; When running tests in c-mode, use single-line comments (//).
-(add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1)))
-
(defun call-with-saved-electric-modes (fn)
(let ((saved-electric (if electric-pair-mode 1 -1))
(saved-layout (if electric-layout-mode 1 -1))
@@ -431,7 +428,9 @@ baz\"\""
:bindings '((electric-pair-skip-whitespace . chomp))
:test-in-strings nil
:test-in-code nil
- :test-in-comments t)
+ :test-in-comments t
+ :fixture-fn (lambda () (when (eq major-mode 'c-mode)
+ (c-toggle-comment-style -1))))
(define-electric-pair-test whitespace-skipping-for-quotes-not-outside
" \" \"" "\"-----" :expected-string "\"\" \" \""