aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/buffer-tests.el
diff options
context:
space:
mode:
authorEli Zaretskii2022-07-07 19:34:30 +0300
committerEli Zaretskii2022-07-07 19:34:30 +0300
commitd397b0421567e4e52bccfa15dc23f4a9b8e6e9f0 (patch)
tree10d873255350238842baebb4f489b45278a12062 /test/src/buffer-tests.el
parent53c0690fa28f338071703f1567d2d1c4054416f0 (diff)
downloademacs-d397b0421567e4e52bccfa15dc23f4a9b8e6e9f0.tar.gz
emacs-d397b0421567e4e52bccfa15dc23f4a9b8e6e9f0.zip
Fix buffer-tests
* test/src/buffer-tests.el (test-restore-buffer-modified-p): Don't assume turning on auto-save-mode cannot auto-save immediately.
Diffstat (limited to 'test/src/buffer-tests.el')
-rw-r--r--test/src/buffer-tests.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 13d48b31a4f..cba10a05025 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -1503,9 +1503,12 @@ with parameters from the *Messages* buffer modification."
1503 1503
1504(ert-deftest test-restore-buffer-modified-p () 1504(ert-deftest test-restore-buffer-modified-p ()
1505 (ert-with-temp-file file 1505 (ert-with-temp-file file
1506 ;; This avoids the annoying "foo and bar are the same file" on
1507 ;; MS-Windows.
1508 (setq file (file-truename file))
1506 (with-current-buffer (find-file file) 1509 (with-current-buffer (find-file file)
1507 (auto-save-mode 1) 1510 (auto-save-mode 1)
1508 (should-not (buffer-modified-p)) 1511 (should-not (eq (buffer-modified-p) t))
1509 (insert "foo") 1512 (insert "foo")
1510 (should (buffer-modified-p)) 1513 (should (buffer-modified-p))
1511 (restore-buffer-modified-p nil) 1514 (restore-buffer-modified-p nil)
@@ -1522,9 +1525,10 @@ with parameters from the *Messages* buffer modification."
1522 (delete-file buffer-auto-save-file-name)))) 1525 (delete-file buffer-auto-save-file-name))))
1523 1526
1524 (ert-with-temp-file file 1527 (ert-with-temp-file file
1528 (setq file (file-truename file))
1525 (with-current-buffer (find-file file) 1529 (with-current-buffer (find-file file)
1526 (auto-save-mode 1) 1530 (auto-save-mode 1)
1527 (should-not (buffer-modified-p)) 1531 (should-not (eq (buffer-modified-p) t))
1528 (insert "foo") 1532 (insert "foo")
1529 (should (buffer-modified-p)) 1533 (should (buffer-modified-p))
1530 (should-not (eq (buffer-modified-p) 'autosaved)) 1534 (should-not (eq (buffer-modified-p) 'autosaved))