emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5352bda: Add test for bug#39680


From: Joo Tvora
Subject: master 5352bda: Add test for bug#39680
Date: Tue, 19 May 2020 19:16:22 -0400 (EDT)

branch: master
commit 5352bda4eeb7415ad2bda5d74e007b4f36021e68
Author: Kévin Le Gouguec <address@hidden>
Commit: João Távora <address@hidden>

    Add test for bug#39680
    
    * test/lisp/electric-tests.el (electric-pair-undo-unrelated-state):
    New test.
---
 test/lisp/electric-tests.el | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 56d1bdb..67f474c 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -547,6 +547,24 @@ baz\"\""
       (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
 (ert-deftest electric-pair-open-extra-newline ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]