emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3020791: Fix files-tests on MS-Windows


From: Eli Zaretskii
Subject: master 3020791: Fix files-tests on MS-Windows
Date: Thu, 11 Nov 2021 03:59:04 -0500 (EST)

branch: master
commit 3020791e77872dbc757beb0ebdd8dbcb5b565f88
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix files-tests on MS-Windows
    
    * lisp/ls-lisp.el (ls-lisp--insert-directory): Fix free disk space
    calculation.  (Bug#50630)
    
    * test/lisp/files-tests.el (files-tests-revert-buffer)
    (files-tests-revert-buffer-with-fine-grain): Disable locking
    files.
---
 lisp/ls-lisp.el          |  2 +-
 test/lisp/files-tests.el | 22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 82153ff..eea8089 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -343,7 +343,7 @@ are also supported; unsupported long options are silently 
ignored."
          (goto-char (point-min))
          ;; First find the line to put it on.
          (when (re-search-forward "^total" nil t)
-           (let ((available (get-free-disk-space ".")))
+           (let ((available (get-free-disk-space orig-file)))
              (when available
                ;; Replace "total" with "total used", to avoid confusion.
                (replace-match "total used in directory")
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index d66ed62..787e639 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1531,10 +1531,13 @@ The door of all subtleties!
   (ert-with-temp-file temp-file-name
     (with-temp-buffer
       (insert files-tests-lao)
-      (write-file temp-file-name)
-      (erase-buffer)
-      (insert files-tests-tzu)
-      (revert-buffer t t t)
+      ;; 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))
       (should (compare-strings files-tests-lao nil nil
                                (buffer-substring (point-min) (point-max))
                                nil nil)))))
@@ -1544,10 +1547,13 @@ The door of all subtleties!
   (ert-with-temp-file temp-file-name
     (with-temp-buffer
       (insert files-tests-lao)
-      (write-file temp-file-name)
-      (erase-buffer)
-      (insert files-tests-tzu)
-      (should (revert-buffer-with-fine-grain t t))
+      ;; 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)))
       (should (compare-strings files-tests-lao nil nil
                                (buffer-substring (point-min) (point-max))
                                nil nil)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]