diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el index d13397274aa..9efcf4a7038 100644 --- a/test/lisp/erc/erc-tests.el +++ b/test/lisp/erc/erc-tests.el @@ -61,13 +61,16 @@ (with-current-buffer (get-buffer-create "*#fake*") (erc-mode) (insert "\n\n") - (setq erc-input-marker (make-marker) ; these are all local - erc-insert-marker (make-marker) - erc-send-completed-hook nil) + (should-not (local-variable-if-set-p 'erc-send-completed-hook)) + (set (make-local-variable 'erc-send-completed-hook) nil) ; skip t (globals) + (setq erc-input-marker (make-marker) + erc-insert-marker (make-marker)) (set-marker erc-insert-marker (point-max)) (erc-display-prompt) (should (= (point) erc-input-marker)) - (add-hook 'erc-pre-send-functions #'erc-add-to-input-ring nil t) + ;; Just in case erc-ring-mode is already on + (setq-local erc-pre-send-functions nil) + (add-hook 'erc-pre-send-functions #'erc-add-to-input-ring) ;; (cl-letf (((symbol-function 'erc-process-input-line) (lambda (&rest _)