aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/lisp/image/image-dired-util-tests.el21
1 files changed, 12 insertions, 9 deletions
diff --git a/test/lisp/image/image-dired-util-tests.el b/test/lisp/image/image-dired-util-tests.el
index 1f3747a82b1..273a32d5dbb 100644
--- a/test/lisp/image/image-dired-util-tests.el
+++ b/test/lisp/image/image-dired-util-tests.el
@@ -57,20 +57,23 @@
57 "jpg"))))) 57 "jpg")))))
58 58
59(ert-deftest image-dired-thumb-name/per-directory () 59(ert-deftest image-dired-thumb-name/per-directory ()
60 (let ((image-dired-thumbnail-storage 'per-directory)) 60 (let ((image-dired-thumbnail-storage 'per-directory)
61 (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) 61 (rel-path "foo.jpg")
62 (should (file-name-absolute-p (image-dired-thumb-name "/tmp/foo.jpg"))) 62 (abs-path "/tmp/foo.jpg")
63 (hash-name (concat (sha1 "foo.jpg") ".jpg")))
64 (should (file-name-absolute-p (image-dired-thumb-name rel-path)))
65 (should (file-name-absolute-p (image-dired-thumb-name abs-path)))
63 (should (equal 66 (should (equal
64 (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) 67 (file-name-nondirectory (image-dired-thumb-name rel-path))
65 (file-name-nondirectory (image-dired-thumb-name "/tmp/foo.jpg")))) 68 (file-name-nondirectory (image-dired-thumb-name abs-path))))
66 ;; The cdr below avoids the system dependency in the car of the 69 ;; The cdr below avoids the system dependency in the car of the
67 ;; list returned by 'file-name-split': it's "" on Posix systems, 70 ;; list returned by 'file-name-split': it's "" on Posix systems,
68 ;; but the drive letter on MS-Windows. 71 ;; but the drive letter on MS-Windows.
69 (should (equal (cdr (file-name-split 72 (should (equal (cdr (file-name-split
70 (image-dired-thumb-name "/tmp/foo.jpg"))) 73 (image-dired-thumb-name abs-path)))
71 '("tmp" ".image-dired" "foo.jpg.thumb.jpg"))) 74 (list "tmp" ".image-dired" hash-name)))
72 (should (equal (file-name-nondirectory 75 (should (equal (file-name-nondirectory
73 (image-dired-thumb-name "foo.jpg")) 76 (image-dired-thumb-name rel-path))
74 "foo.jpg.thumb.jpg")))) 77 hash-name))))
75 78
76;;; image-dired-util-tests.el ends here 79;;; image-dired-util-tests.el ends here