]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix files-tests on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Thu, 11 Nov 2021 08:58:10 +0000 (10:58 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 11 Nov 2021 08:58:10 +0000 (10:58 +0200)
* 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
test/lisp/files-tests.el

index 82153ff0adb68d813301c1d64c2b3ef294a0d170..eea8089daa7439e30b439a6306e82759bed4c2cd 100644 (file)
@@ -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")
index d66ed62e286b57cb716ba32548e2ca80c9bcc80e..787e6390a6e7ea90e6fcb86c5d0e56a5c44065bf 100644 (file)
@@ -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)))))