[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 39dbd1c: : Tests for undo-auto functionality.
From: |
Phillip Lord |
Subject: |
[Emacs-diffs] master 39dbd1c: : Tests for undo-auto functionality. |
Date: |
Thu, 12 Nov 2015 22:19:28 +0000 |
branch: master
commit 39dbd1cd0f6cc007722f1d120d3be219d1cb5963
Author: Phillip Lord <address@hidden>
Commit: Phillip Lord <address@hidden>
: Tests for undo-auto functionality.
---
test/automated/simple-test.el | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/test/automated/simple-test.el b/test/automated/simple-test.el
index 5bfb746..86c9fc2 100644
--- a/test/automated/simple-test.el
+++ b/test/automated/simple-test.el
@@ -202,5 +202,38 @@
(unless (or noninteractive 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)
;;; simple-test.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 39dbd1c: : Tests for undo-auto functionality.,
Phillip Lord <=