mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
: Tests for undo-auto functionality.
This commit is contained in:
parent
20aa42e820
commit
39dbd1cd0f
1 changed files with 33 additions and 0 deletions
|
|
@ -202,5 +202,38 @@
|
||||||
(unless (or noninteractive python)
|
(unless (or noninteractive python)
|
||||||
(unload-feature 'python)))))
|
(unload-feature 'python)))))
|
||||||
|
|
||||||
|
|
||||||
|
;;; auto-boundary tests
|
||||||
|
(ert-deftest undo-auto--boundary-timer ()
|
||||||
|
(should
|
||||||
|
undo-auto--current-boundary-timer))
|
||||||
|
|
||||||
|
(ert-deftest undo-auto--boundaries-added ()
|
||||||
|
;; The change in the buffer should have caused addition
|
||||||
|
;; to undo-auto--undoably-changed-buffers.
|
||||||
|
(should
|
||||||
|
(with-temp-buffer
|
||||||
|
(setq buffer-undo-list nil)
|
||||||
|
(insert "hello")
|
||||||
|
(member (current-buffer) undo-auto--undoably-changed-buffers)))
|
||||||
|
;; The head of buffer-undo-list should be the insertion event, and
|
||||||
|
;; therefore not nil
|
||||||
|
(should
|
||||||
|
(with-temp-buffer
|
||||||
|
(setq buffer-undo-list nil)
|
||||||
|
(insert "hello")
|
||||||
|
(car buffer-undo-list)))
|
||||||
|
;; Now the head of the buffer-undo-list should be a boundary and so
|
||||||
|
;; nil. We have to call auto-boundary explicitly because we are out
|
||||||
|
;; of the command loop
|
||||||
|
(should-not
|
||||||
|
(with-temp-buffer
|
||||||
|
(setq buffer-undo-list nil)
|
||||||
|
(insert "hello")
|
||||||
|
(car buffer-undo-list)
|
||||||
|
(undo-auto--boundaries 'test))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'simple-test)
|
(provide 'simple-test)
|
||||||
;;; simple-test.el ends here
|
;;; simple-test.el ends here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue