]> git.eshelyaron.com Git - emacs.git/commitdiff
; Don't fail image tests if jpeg is supported via imagemagick
authorUlrich Müller <ulm@gentoo.org>
Fri, 21 Feb 2025 11:13:20 +0000 (12:13 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Feb 2025 08:07:22 +0000 (09:07 +0100)
* test/lisp/image-tests.el (image-supported-file-p/optional):
Consider also the imagemagick case.  (Bug#76465)

(cherry picked from commit 76b938fc1d24b9dcc0c50db1dc520fbdacc19a16)

test/lisp/image-tests.el

index 03d207580520328f9950fda16ce11de2aeeccd46..455118cb98cdd731aacb32424562895b212b3f20 100644 (file)
   (should (eq (image-supported-file-p "foo.pbm") 'pbm)))
 
 (ert-deftest image-supported-file-p/optional ()
-  (if (image-type-available-p 'jpeg)
-      (should (eq (image-supported-file-p "foo.jpg") 'jpeg))
-    (should-not (image-supported-file-p "foo.jpg"))))
+  (cond ((image-type-available-p 'jpeg)
+         (should (eq (image-supported-file-p "foo.jpg") 'jpeg)))
+        ((fboundp 'imagemagick-types)
+         (should (eq (image-supported-file-p "foo.jpg") 'imagemagick)))
+        (nil
+         (should-not (image-supported-file-p "foo.jpg")))))
 
 (ert-deftest image-supported-file-p/unsupported-returns-nil ()
   (should-not (image-supported-file-p "foo.some-unsupported-format")))