]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix some dired-tests.el on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 1 Aug 2017 14:45:25 +0000 (17:45 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 1 Aug 2017 14:45:25 +0000 (17:45 +0300)
* test/lisp/dired-tests.el (dired-test-bug27243-01)
(dired-test-bug27243-02): On MS-Windows, pass test-dir through
file-truename, to avoid bogus failures due to file-name comparison
as strings.

test/lisp/dired-tests.el

index 5900fead7d1b967509cebca4559473b752d02f5b..8657910a496ec73967076d32adeaa0290c4430a3 100644 (file)
   "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#5 ."
   (let ((test-dir (file-name-as-directory (make-temp-file "test-dir-" t)))
         (dired-auto-revert-buffer t) buffers)
+    ;; On MS-Windows, get rid of 8+3 short names in test-dir, if the
+    ;; corresponding long file names exist, otherwise such names trip
+    ;; dired-buffers-for-dir.
+    (if (eq system-type 'windows-nt)
+        (setq test-dir (file-truename test-dir)))
     (should-not (dired-buffers-for-dir test-dir))
     (with-current-buffer (find-file-noselect test-dir)
       (make-directory "test-subdir"))
   "Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27243#28 ."
   (let ((test-dir (make-temp-file "test-dir-" t))
         (dired-auto-revert-buffer t) buffers)
+    ;; On MS-Windows, get rid of 8+3 short names in test-dir, if the
+    ;; corresponding long file names exist, otherwise such names trip
+    ;; string comparisons below.
+    (if (eq system-type 'windows-nt)
+        (setq test-dir (file-truename test-dir)))
     (with-current-buffer (find-file-noselect test-dir)
       (make-directory "test-subdir"))
     (push (dired test-dir) buffers)