diff options
| author | Stefan Kangas | 2022-09-21 15:13:40 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-09-21 15:15:42 +0200 |
| commit | 661be73b5eb148a6cd6d79837487375cfd422d4d (patch) | |
| tree | 274b37e8fff59c64b9ec608fa07eb6a510e0a99f | |
| parent | 13bd79e34fc6085410057f669cea435f2d1d046a (diff) | |
| download | emacs-661be73b5eb148a6cd6d79837487375cfd422d4d.tar.gz emacs-661be73b5eb148a6cd6d79837487375cfd422d4d.zip | |
* test/lisp/image/image-dired-util-tests.el: New file.
| -rw-r--r-- | test/lisp/image/image-dired-util-tests.el | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/lisp/image/image-dired-util-tests.el b/test/lisp/image/image-dired-util-tests.el new file mode 100644 index 00000000000..547e3914013 --- /dev/null +++ b/test/lisp/image/image-dired-util-tests.el | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | ;;; image-dired-util-tests.el --- Tests for image-dired.el -*- lexical-binding: t -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2022 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Code: | ||
| 21 | |||
| 22 | (require 'ert) | ||
| 23 | (require 'image-dired) | ||
| 24 | (require 'image-dired-util) | ||
| 25 | |||
| 26 | (ert-deftest image-dired-thumb-name () | ||
| 27 | (let ((image-dired-thumbnail-storage 'standard)) | ||
| 28 | (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) | ||
| 29 | (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) | ||
| 30 | "4abfc97f9a5d3c4c519bfb23e4da8b90.png"))) | ||
| 31 | (let ((image-dired-thumbnail-storage 'image-dired)) | ||
| 32 | (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) | ||
| 33 | (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) | ||
| 34 | "foo_5baffb8d7984b3088db58efd7d8909c5.thumb.jpg"))) | ||
| 35 | (let ((image-dired-thumbnail-storage 'per-directory)) | ||
| 36 | (should (file-name-absolute-p (image-dired-thumb-name "foo.jpg"))) | ||
| 37 | (should (equal (file-name-nondirectory (image-dired-thumb-name "foo.jpg")) | ||
| 38 | "foo.thumb.jpg")))) | ||
| 39 | |||
| 40 | ;;; image-dired-util-tests.el ends here | ||