Fix an eshell ls dired test for non-recent files
authorGlenn Morris <rgm@gnu.org>
Sat, 15 Dec 2018 22:49:46 +0000 (14:49 -0800)
committerAndreas Beckmann <anbe@debian.org>
Sun, 27 Jan 2019 16:51:42 +0000 (17:51 +0100)
* test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27844):
Work around an eshell issue with non-recent files.  (Bug#33734)

test/lisp/eshell/em-ls-tests.el

index 1ce832f1dccf4941b4ac30b26432a796d9aff737..ab73bc427a51a7495b2d68f97b612b06b99eab18 100644 (file)
           (dired-toggle-marks)
           (should (cdr (dired-get-marked-files)))
           (kill-buffer buf)
-          (setq buf (dired (expand-file-name "lisp/subr.el" source-directory)))
+          ;; Eshell's default format duplicates the year for non-recent files,
+          ;; eg "2015-05-06  2015", which doesn't make a lot of sense,
+          ;; and causes this portion of the test to fail if subr.el
+          ;; is non-recent (eg if building from a tarfile unpacked
+          ;; with a fixed early timestamp for reproducibility).  Bug#33734.
+          (let ((eshell-ls-date-format "%b %e"))
+            (setq buf (dired (expand-file-name "lisp/subr.el"
+                                               source-directory))))
           (should (looking-at "subr\\.el")))
       (customize-set-variable 'eshell-ls-use-in-dired orig)
       (and (buffer-live-p buf) (kill-buffer)))))