; 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)
committerUlrich Müller <ulm@gentoo.org>
Fri, 21 Feb 2025 12:02:58 +0000 (13:02 +0100)
* test/lisp/image-tests.el (image-supported-file-p/optional):
Consider also the imagemagick case.  (Bug#76465)

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")))