Commit 5352bda4 authored by Kévin Le Gouguec's avatar Kévin Le Gouguec Committed by João Távora

Add test for bug#39680

* test/lisp/electric-tests.el (electric-pair-undo-unrelated-state):
New test.
parent babdd2e9
Pipeline #5622 passed with stage
in 65 minutes and 59 seconds
......@@ -546,6 +546,24 @@ baz\"\""
(electric-pair-delete-pair 1)
(should (equal "" (buffer-string))))))
;;; Undoing
(ert-deftest electric-pair-undo-unrelated-state ()
"Make sure `electric-pair-mode' does not confuse `undo' (bug#39680)."
(with-temp-buffer
(buffer-enable-undo)
(electric-pair-local-mode)
(let ((last-command-event ?\())
(ert-simulate-command '(self-insert-command 1)))
(undo-boundary)
(let ((last-command-event ?a))
(ert-simulate-command '(self-insert-command 1)))
(undo-boundary)
(ert-simulate-command '(undo))
(let ((last-command-event ?\())
(ert-simulate-command '(self-insert-command 1)))
(should (string= (buffer-string) "(())"))))
;;; Electric newlines between pairs
;;; TODO: better tests
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment