diff options
Diffstat (limited to 'test/lisp/image-tests.el')
-rw-r--r-- | test/lisp/image-tests.el | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index ab7585ca050..aa8600609c4 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -25,7 +25,7 @@ (require 'cl-lib)) (defconst image-tests--emacs-images-directory - (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY")) + (expand-file-name "images" data-directory) "Directory containing Emacs images.") (ert-deftest image--set-property () @@ -48,6 +48,20 @@ (setf (image-property image :width) nil) (should (equal image '(image))))) +(ert-deftest image-find-image () + (find-image '((:type xpm :file "undo.xpm"))) + (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center)))) + +(ert-deftest image-type-from-file-name () + (should (eq (image-type-from-file-name "foo.jpg") 'jpeg)) + (should (eq (image-type-from-file-name "foo.png") 'png))) + +(ert-deftest image-type/from-filename () + ;; On emba, `image-types' and `image-load-path' do not exist. + (skip-unless (and (bound-and-true-p image-types) + (bound-and-true-p image-load-path))) + (should (eq (image-type "foo.jpg") 'jpeg))) + (ert-deftest image-type-from-file-header-test () "Test image-type-from-file-header." (should (eq (if (image-type-available-p 'svg) 'svg) |