Subject: bug#73440: 31.0.50; shr-test/zoom-condition test fails if built w/o libxml2 support

From: Eli Zaretskii <[email-masked]>
Date: Mon, 23 Sep 2024 17:24:42 +0300

> Cc: , Jim Porter <[email-masked]>
> From: Sam James <[email-masked]>
> Date: Mon, 23 Sep 2024 14:11:20 +0100
> 
> When building Emacs 31 without libxml2 support, I get a test failure:
> """
> Test shr-test/zoom-image condition:
>     Info: image with alt=nil
>     (void-function libxml-parse-html-region)
>    FAILED  3/4  shr-test/zoom-image (0.000144 sec) at lisp/net/shr-tests.el:136
>    passed  4/4  use-cookies (0.010334 sec)
> 
> Ran 4 tests, 2 results as expected, 1 unexpected, 1 skipped (2024-09-23 14:07:16+0100, 0.081556 sec)
> 
> 1 unexpected results:
>    FAILED  shr-test/zoom-image  libxml-parse-html-region
> 
> 1 skipped results:
>   SKIPPED  rendering  ((skip-unless (fboundp 'libxml-parse-html-region)) :form (fboundp libxml-parse-html-region) :value nil)
> """
> 
> Building with libxml2 support enabled fixes the test.

Thanks, does the patch below solve the problem in a build without
libxml2?

diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
index f8559df..d0fe803 100644
--- a/test/lisp/net/shr-tests.el
+++ b/test/lisp/net/shr-tests.el
@@ -136,6 +136,7 @@ shr-srcset
 (ert-deftest shr-test/zoom-image ()
   "Test that `shr-zoom-image' properly replaces the original image."
   (skip-unless (bound-and-true-p image-types))
+  (skip-unless (libxml-available-p))
   (let* ((image (expand-file-name "data/image/blank-100x200.png"
                                   (getenv "EMACS_TEST_DIRECTORY")))
          (image-url (concat "file://" (if (string-prefix-p "/" image)