1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00

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.
This commit is contained in:
Eli Zaretskii 2022-07-07 19:34:30 +03:00
parent 53c0690fa2
commit d397b04215

View File

@ -1503,9 +1503,12 @@ with parameters from the *Messages* buffer modification."
(ert-deftest test-restore-buffer-modified-p ()
(ert-with-temp-file file
;; This avoids the annoying "foo and bar are the same file" on
;; MS-Windows.
(setq file (file-truename file))
(with-current-buffer (find-file file)
(auto-save-mode 1)
(should-not (buffer-modified-p))
(should-not (eq (buffer-modified-p) t))
(insert "foo")
(should (buffer-modified-p))
(restore-buffer-modified-p nil)
@ -1522,9 +1525,10 @@ with parameters from the *Messages* buffer modification."
(delete-file buffer-auto-save-file-name))))
(ert-with-temp-file file
(setq file (file-truename file))
(with-current-buffer (find-file file)
(auto-save-mode 1)
(should-not (buffer-modified-p))
(should-not (eq (buffer-modified-p) t))
(insert "foo")
(should (buffer-modified-p))
(should-not (eq (buffer-modified-p) 'autosaved))