From 8548ad2cb3f0eff766cc87d0db78a09972c72acc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 15 Mar 2021 01:43:11 +0100 Subject: [PATCH] Add three new tests for image.el * test/lisp/image-tests.el (image-find-image) (image-type-from-file-name, image-type/from-filename): New tests. --- test/lisp/image-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index ab7585ca050..bb42ffae18e 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -48,6 +48,17 @@ (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 () + (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) -- 2.39.5