diff options
| author | Kévin Le Gouguec | 2020-05-19 23:17:04 +0200 |
|---|---|---|
| committer | João Távora | 2020-05-20 00:15:11 +0100 |
| commit | 5352bda4eeb7415ad2bda5d74e007b4f36021e68 (patch) | |
| tree | 6e5b120a127564148db8eaf3af7f258ee0d3df0d | |
| parent | babdd2e90e170bd99b7d3e3331fec14d31771a5a (diff) | |
| download | emacs-5352bda4eeb7415ad2bda5d74e007b4f36021e68.tar.gz emacs-5352bda4eeb7415ad2bda5d74e007b4f36021e68.zip | |
Add test for bug#39680
* test/lisp/electric-tests.el (electric-pair-undo-unrelated-state):
New test.
| -rw-r--r-- | test/lisp/electric-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 56d1bdb110e..67f474cbd52 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el | |||
| @@ -547,6 +547,24 @@ baz\"\"" | |||
| 547 | (should (equal "" (buffer-string)))))) | 547 | (should (equal "" (buffer-string)))))) |
| 548 | 548 | ||
| 549 | 549 | ||
| 550 | ;;; Undoing | ||
| 551 | (ert-deftest electric-pair-undo-unrelated-state () | ||
| 552 | "Make sure `electric-pair-mode' does not confuse `undo' (bug#39680)." | ||
| 553 | (with-temp-buffer | ||
| 554 | (buffer-enable-undo) | ||
| 555 | (electric-pair-local-mode) | ||
| 556 | (let ((last-command-event ?\()) | ||
| 557 | (ert-simulate-command '(self-insert-command 1))) | ||
| 558 | (undo-boundary) | ||
| 559 | (let ((last-command-event ?a)) | ||
| 560 | (ert-simulate-command '(self-insert-command 1))) | ||
| 561 | (undo-boundary) | ||
| 562 | (ert-simulate-command '(undo)) | ||
| 563 | (let ((last-command-event ?\()) | ||
| 564 | (ert-simulate-command '(self-insert-command 1))) | ||
| 565 | (should (string= (buffer-string) "(())")))) | ||
| 566 | |||
| 567 | |||
| 550 | ;;; Electric newlines between pairs | 568 | ;;; Electric newlines between pairs |
| 551 | ;;; TODO: better tests | 569 | ;;; TODO: better tests |
| 552 | (ert-deftest electric-pair-open-extra-newline () | 570 | (ert-deftest electric-pair-open-extra-newline () |