1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
Description: Fix test suite with libxml2 2.13.0
(shortened to the tests we actually run)
Origin: https://github.com/shlomif/perl-XML-LibXML/pull/87
via Ubuntu
Forwarded: https://github.com/shlomif/perl-XML-LibXML/pull/87
Bug-Debian: https://bugs.debian.org/1106827
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2025-08-14
--- a/t/02parse.t
+++ b/t/02parse.t
@@ -14,7 +14,7 @@
POSIX::setlocale(LC_ALL, "C");
-use Test::More tests => 533;
+use Test::More tests => 531;
use IO::File;
use XML::LibXML::Common qw(:libxml);
@@ -771,15 +771,6 @@
my $newkid = $root->appendChild( $doc->createElement( "bar" ) );
is( $newkid->line_number(), 0, "line number is 0");
-
- $parser->line_numbers(0);
- eval { $doc = $parser->parse_string( $goodxml ); };
-
- $root = $doc->documentElement();
- is( $root->line_number(), 0, "line number is 0");
-
- @kids = $root->childNodes();
- is( $kids[1]->line_number(), 0, "line number is 0");
}
SKIP: {
@@ -882,7 +873,12 @@
eval {
$doc2 = $parser->parse_string( $xmldoc );
};
- isnt($@, '', "error parsing $xmldoc");
+ # https://gitlab.gnome.org/GNOME/libxml2/-/commit/b717abdd
+ if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) {
+ isnt($@, '', "error parsing $xmldoc");
+ } else {
+ is( $doc2->documentElement()->firstChild()->nodeName(), "foo" );
+ }
$parser->validation(1);
--- a/t/08findnodes.t
+++ b/t/08findnodes.t
@@ -123,7 +123,13 @@
my @ns = $root->findnodes('namespace::*');
# TEST
-is(scalar(@ns), 2, ' TODO : Add test name' );
+# https://gitlab.gnome.org/GNOME/libxml2/-/commit/aca16fb3
+# fixed xmlCopyNamespace with XML namespace.
+if (XML::LibXML::LIBXML_RUNTIME_VERSION() < 21300) {
+ is(scalar(@ns), 2, ' TODO : Add test name' );
+} else {
+ is(scalar(@ns), 3, ' TODO : Add test name' );
+}
# bad xpaths
# TEST:$badxpath=4;
--- a/t/16docnodes.t
+++ b/t/16docnodes.t
@@ -60,7 +60,12 @@
$doc->setDocumentElement($node);
# TEST
- is( $node->serialize(), '<test contents="ä"/>', 'Node serialise works.' );
+ # libxml2 2.14 avoids unnecessary escaping of attribute values.
+ if (XML::LibXML::LIBXML_VERSION() >= 21400) {
+ is( $node->serialize(), "<test contents=\"\xE4\"/>", 'Node serialise works.' );
+ } else {
+ is( $node->serialize(), '<test contents="ä"/>', 'Node serialise works.' );
+ }
$doc->setEncoding('utf-8');
# Second output
|