aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2021-11-11 10:58:10 +0200
committerEli Zaretskii2021-11-11 10:58:10 +0200
commit3020791e77872dbc757beb0ebdd8dbcb5b565f88 (patch)
treef47ea16743c33d0d88f820a1a43770e034c9e296
parentf96380eb80c81824a2710b7d9846dd91b816abad (diff)
downloademacs-3020791e77872dbc757beb0ebdd8dbcb5b565f88.tar.gz
emacs-3020791e77872dbc757beb0ebdd8dbcb5b565f88.zip
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.
-rw-r--r--lisp/ls-lisp.el2
-rw-r--r--test/lisp/files-tests.el22
2 files changed, 15 insertions, 9 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 82153ff0adb..eea8089daa7 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -343,7 +343,7 @@ are also supported; unsupported long options are silently ignored."
343 (goto-char (point-min)) 343 (goto-char (point-min))
344 ;; First find the line to put it on. 344 ;; First find the line to put it on.
345 (when (re-search-forward "^total" nil t) 345 (when (re-search-forward "^total" nil t)
346 (let ((available (get-free-disk-space "."))) 346 (let ((available (get-free-disk-space orig-file)))
347 (when available 347 (when available
348 ;; Replace "total" with "total used", to avoid confusion. 348 ;; Replace "total" with "total used", to avoid confusion.
349 (replace-match "total used in directory") 349 (replace-match "total used in directory")
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index d66ed62e286..787e6390a6e 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -1531,10 +1531,13 @@ The door of all subtleties!
1531 (ert-with-temp-file temp-file-name 1531 (ert-with-temp-file temp-file-name
1532 (with-temp-buffer 1532 (with-temp-buffer
1533 (insert files-tests-lao) 1533 (insert files-tests-lao)
1534 (write-file temp-file-name) 1534 ;; Disable lock files, since that barfs in
1535 (erase-buffer) 1535 ;; userlock--check-content-unchanged on MS-Windows.
1536 (insert files-tests-tzu) 1536 (let (create-lockfiles)
1537 (revert-buffer t t t) 1537 (write-file temp-file-name)
1538 (erase-buffer)
1539 (insert files-tests-tzu)
1540 (revert-buffer t t t))
1538 (should (compare-strings files-tests-lao nil nil 1541 (should (compare-strings files-tests-lao nil nil
1539 (buffer-substring (point-min) (point-max)) 1542 (buffer-substring (point-min) (point-max))
1540 nil nil))))) 1543 nil nil)))))
@@ -1544,10 +1547,13 @@ The door of all subtleties!
1544 (ert-with-temp-file temp-file-name 1547 (ert-with-temp-file temp-file-name
1545 (with-temp-buffer 1548 (with-temp-buffer
1546 (insert files-tests-lao) 1549 (insert files-tests-lao)
1547 (write-file temp-file-name) 1550 ;; Disable lock files, since that barfs in
1548 (erase-buffer) 1551 ;; userlock--check-content-unchanged on MS-Windows.
1549 (insert files-tests-tzu) 1552 (let (create-lockfiles)
1550 (should (revert-buffer-with-fine-grain t t)) 1553 (write-file temp-file-name)
1554 (erase-buffer)
1555 (insert files-tests-tzu)
1556 (should (revert-buffer-with-fine-grain t t)))
1551 (should (compare-strings files-tests-lao nil nil 1557 (should (compare-strings files-tests-lao nil nil
1552 (buffer-substring (point-min) (point-max)) 1558 (buffer-substring (point-min) (point-max))
1553 nil nil))))) 1559 nil nil)))))