diff options
| author | Phillip Lord | 2015-11-12 22:18:59 +0000 |
|---|---|---|
| committer | Phillip Lord | 2015-11-12 22:18:59 +0000 |
| commit | 39dbd1cd0f6cc007722f1d120d3be219d1cb5963 (patch) | |
| tree | 4d1151c54264f0fa1773cc996307b177b6358d52 | |
| parent | 20aa42e8204f8f0139ba3880cb32ddf88acc9bf4 (diff) | |
| download | emacs-39dbd1cd0f6cc007722f1d120d3be219d1cb5963.tar.gz emacs-39dbd1cd0f6cc007722f1d120d3be219d1cb5963.zip | |
: Tests for undo-auto functionality.
| -rw-r--r-- | 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 5bfb74615a4..86c9fc2e767 100644 --- a/test/automated/simple-test.el +++ b/test/automated/simple-test.el | |||
| @@ -202,5 +202,38 @@ | |||
| 202 | (unless (or noninteractive python) | 202 | (unless (or noninteractive python) |
| 203 | (unload-feature 'python))))) | 203 | (unload-feature 'python))))) |
| 204 | 204 | ||
| 205 | |||
| 206 | ;;; auto-boundary tests | ||
| 207 | (ert-deftest undo-auto--boundary-timer () | ||
| 208 | (should | ||
| 209 | undo-auto--current-boundary-timer)) | ||
| 210 | |||
| 211 | (ert-deftest undo-auto--boundaries-added () | ||
| 212 | ;; The change in the buffer should have caused addition | ||
| 213 | ;; to undo-auto--undoably-changed-buffers. | ||
| 214 | (should | ||
| 215 | (with-temp-buffer | ||
| 216 | (setq buffer-undo-list nil) | ||
| 217 | (insert "hello") | ||
| 218 | (member (current-buffer) undo-auto--undoably-changed-buffers))) | ||
| 219 | ;; The head of buffer-undo-list should be the insertion event, and | ||
| 220 | ;; therefore not nil | ||
| 221 | (should | ||
| 222 | (with-temp-buffer | ||
| 223 | (setq buffer-undo-list nil) | ||
| 224 | (insert "hello") | ||
| 225 | (car buffer-undo-list))) | ||
| 226 | ;; Now the head of the buffer-undo-list should be a boundary and so | ||
| 227 | ;; nil. We have to call auto-boundary explicitly because we are out | ||
| 228 | ;; of the command loop | ||
| 229 | (should-not | ||
| 230 | (with-temp-buffer | ||
| 231 | (setq buffer-undo-list nil) | ||
| 232 | (insert "hello") | ||
| 233 | (car buffer-undo-list) | ||
| 234 | (undo-auto--boundaries 'test)))) | ||
| 235 | |||
| 236 | |||
| 237 | |||
| 205 | (provide 'simple-test) | 238 | (provide 'simple-test) |
| 206 | ;;; simple-test.el ends here | 239 | ;;; simple-test.el ends here |