Subject: bug#76465: 30.1; Test failure in image-supported-file-p/optional

From: Ulrich Müller <[email-masked]>
Date: Fri, 21 Feb 2025 12:20:50 +0100

Attached patch fixes the problem for me.

>From f5b89a94c7af3bb89fcd72214de5c09f13c47d75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email-masked]>
Date: Fri, 21 Feb 2025 12:13:20 +0100
Subject: [PATCH] ; Don't fail image tests if jpeg is supported via imagemagick

* test/lisp/image-tests.el (image-supported-file-p/optional):
Consider also the imagemagick case.  (Bug#76465)
---
 test/lisp/image-tests.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index 03d20758052..455118cb98c 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -80,9 +80,12 @@ image-supported-file-p/built-in
   (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")))
-- 
2.48.1