diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/simple-tests.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el index 12ebc75ea92..40cd1d29498 100644 --- a/test/lisp/simple-tests.el +++ b/test/lisp/simple-tests.el | |||
| @@ -310,6 +310,38 @@ | |||
| 310 | (= 6 | 310 | (= 6 |
| 311 | (undo-test-point-after-forward-kill)))) | 311 | (undo-test-point-after-forward-kill)))) |
| 312 | 312 | ||
| 313 | (defmacro simple-test-undo-with-switched-buffer (buffer &rest body) | ||
| 314 | (let ((before-buffer (make-symbol "before-buffer"))) | ||
| 315 | `(let ((,before-buffer (current-buffer))) | ||
| 316 | (unwind-protect | ||
| 317 | (progn | ||
| 318 | (switch-to-buffer ,buffer) | ||
| 319 | ,@body) | ||
| 320 | (switch-to-buffer ,before-buffer))))) | ||
| 321 | |||
| 322 | ;; This tests for a regression in emacs 25.0 see bug #23632 | ||
| 323 | (ert-deftest simple-test-undo-extra-boundary-in-tex () | ||
| 324 | (should | ||
| 325 | (string= | ||
| 326 | "" | ||
| 327 | (simple-test-undo-with-switched-buffer | ||
| 328 | "temp.tex" | ||
| 329 | (latex-mode) | ||
| 330 | ;; This macro calls `latex-insert-block' | ||
| 331 | (execute-kbd-macro | ||
| 332 | (read-kbd-macro | ||
| 333 | " | ||
| 334 | C-c C-o ;; latex-insert-block | ||
| 335 | RET ;; newline | ||
| 336 | C-/ ;; undo | ||
| 337 | " | ||
| 338 | )) | ||
| 339 | (buffer-substring-no-properties | ||
| 340 | (point-min) | ||
| 341 | (point-max)))))) | ||
| 342 | |||
| 343 | |||
| 344 | |||
| 313 | 345 | ||
| 314 | (provide 'simple-test) | 346 | (provide 'simple-test) |
| 315 | ;;; simple-test.el ends here | 347 | ;;; simple-test.el ends here |