[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a3c5638db6: Fix files-tests on MS-Windows
From: |
Eli Zaretskii |
Subject: |
master a3c5638db6: Fix files-tests on MS-Windows |
Date: |
Thu, 17 Feb 2022 09:31:03 -0500 (EST) |
branch: master
commit a3c5638db653fe3458256d9e58ba41ff50962b83
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Fix files-tests on MS-Windows
* test/lisp/files-tests.el
(files-tests-zzdont-rewrite-precious-files): Renamed from
'files-tests-dont-rewrite-precious-files', to fix a subtle problem
that breaks 2 tests on MS-Windows.
(files-tests-revert-buffer)
(files-tests-revert-buffer-with-fine-grain): No need to disable
file locking anymore.
---
test/lisp/files-tests.el | 27 ++++++++++++---------------
1 file changed, 12 insertions(+), 15 deletions(-)
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 5d0a1bc2f3..42b09201de 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1411,7 +1411,10 @@ See <https://debbugs.gnu.org/35241>."
(equal tmpfile
(executable-find (file-name-nondirectory tmpfile)))))))
-(ert-deftest files-tests-dont-rewrite-precious-files ()
+;; Note: we call this test "...-zzdont..." so that it runs near the
+;; end, because otherwise the advice it adds to write-region doesn't
+;; get removed(??) and breaks the revert-file tests on MS-Windows.
+(ert-deftest files-tests-zzdont-rewrite-precious-files ()
"Test that `file-precious-flag' forces files to be saved by
renaming only, rather than modified in-place."
(ert-with-temp-file temp-file-name
@@ -1540,13 +1543,10 @@ The door of all subtleties!
(ert-with-temp-file temp-file-name
(with-temp-buffer
(insert files-tests-lao)
- ;; Disable lock files, since that barfs in
- ;; userlock--check-content-unchanged on MS-Windows.
- (let (create-lockfiles)
- (write-file temp-file-name)
- (erase-buffer)
- (insert files-tests-tzu)
- (revert-buffer t t t))
+ (write-file temp-file-name)
+ (erase-buffer)
+ (insert files-tests-tzu)
+ (revert-buffer t t t)
(should (compare-strings files-tests-lao nil nil
(buffer-substring (point-min) (point-max))
nil nil)))))
@@ -1556,13 +1556,10 @@ The door of all subtleties!
(ert-with-temp-file temp-file-name
(with-temp-buffer
(insert files-tests-lao)
- ;; Disable lock files, since that barfs in
- ;; userlock--check-content-unchanged on MS-Windows.
- (let (create-lockfiles)
- (write-file temp-file-name)
- (erase-buffer)
- (insert files-tests-tzu)
- (should (revert-buffer-with-fine-grain t t)))
+ (write-file temp-file-name)
+ (erase-buffer)
+ (insert files-tests-tzu)
+ (should (revert-buffer-with-fine-grain t t))
(should (compare-strings files-tests-lao nil nil
(buffer-substring (point-min) (point-max))
nil nil)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master a3c5638db6: Fix files-tests on MS-Windows,
Eli Zaretskii <=