Fix mistake in test for erc-ring-previous-command

* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
The variable erc-send-completed-hook was previously set to nil
permanently, which would affect other tests (bug#50005).
This commit is contained in:
F. Jason Park 2021-09-16 15:20:59 +02:00 committed by Lars Ingebrigtsen
parent f3762d59d9
commit 492fd05ac2

View file

@ -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 _)