https://github.com/shlomif/perl-XML-LibXML/pull/87 --- XML-LibXML-2.0210/t/02parse.t.orig +++ XML-LibXML-2.0210/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); @@ -25,7 +25,7 @@ use Errno qw(ENOENT); -# TEST*533 +# TEST*531 ## # test values @@ -773,15 +773,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: { @@ -884,7 +875,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); --- XML-LibXML-2.0210/t/08findnodes.t.orig +++ XML-LibXML-2.0210/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; --- XML-LibXML-2.0210/t/16docnodes.t.orig +++ XML-LibXML-2.0210/t/16docnodes.t @@ -60,7 +60,12 @@ $doc->setDocumentElement($node); # TEST - is( $node->serialize(), '', 'Node serialise works.' ); + # libxml2 2.14 avoids unnecessary escaping of attribute values. + if (XML::LibXML::LIBXML_VERSION() >= 21400) { + is( $node->serialize(), "", 'Node serialise works.' ); + } else { + is( $node->serialize(), '', 'Node serialise works.' ); + } $doc->setEncoding('utf-8'); # Second output --- XML-LibXML-2.0210/t/19die_on_invalid_utf8_rt_58848.t.orig +++ XML-LibXML-2.0210/t/19die_on_invalid_utf8_rt_58848.t @@ -16,7 +16,7 @@ my $err = $@; # TEST - like ("$err", qr{parser error : Input is not proper UTF-8}, + like ("$err", qr{not proper UTF-8|Invalid bytes in character encoding}, 'Parser error.', ); } --- XML-LibXML-2.0210/t/25relaxng.t.orig +++ XML-LibXML-2.0210/t/25relaxng.t @@ -132,7 +132,7 @@ { my $rng = eval { XML::LibXML::RelaxNG->new( location => $netfile, no_network => 1 ) }; # TEST - like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' ); + like( $@, qr{Attempt to load network entity}, 'RNG from file location with external import and no_network => 1 throws an exception.' ); # TEST ok( !defined $rng, 'RNG from file location with external import and no_network => 1 is not loaded.' ); } @@ -152,7 +152,7 @@ EOF # TEST - like( $@, qr{I/O error : Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' ); + like( $@, qr{Attempt to load network entity}, 'RNG from buffer with external import and no_network => 1 throws an exception.' ); # TEST ok( !defined $rng, 'RNG from buffer with external import and no_network => 1 is not loaded.' ); } --- XML-LibXML-2.0210/t/26schema.t.orig +++ XML-LibXML-2.0210/t/26schema.t @@ -117,7 +117,7 @@ { my $schema = eval { XML::LibXML::Schema->new( location => $netfile, no_network => 1 ) }; # TEST - like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' ); + like( $@, qr{Attempt to load network entity}, 'Schema from file location with external import and no_network => 1 throws an exception.' ); # TEST ok( !defined $schema, 'Schema from file location with external import and no_network => 1 is not loaded.' ); } @@ -129,7 +129,7 @@ EOF # TEST - like( $@, qr{I/O error : Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' ); + like( $@, qr{Attempt to load network entity}, 'Schema from buffer with external import and no_network => 1 throws an exception.' ); # TEST ok( !defined $schema, 'Schema from buffer with external import and no_network => 1 is not loaded.' ); } --- XML-LibXML-2.0210/t/49_load_html.t.orig +++ XML-LibXML-2.0210/t/49_load_html.t @@ -52,7 +52,13 @@ EOS - { + SKIP: { + # libxml2 2.14 tokenizes HTML according to HTML5 where + # this isn't an error, see "13.2.5.73 Named character + # reference state". + skip("libxml2 version >= 21400", 1) + if XML::LibXML::LIBXML_VERSION >= 21400; + my $buf = ''; open my $fh, '>', \$buf; # redirect STDERR there --- XML-LibXML-2.0210/t/60error_prev_chain.t.orig +++ XML-LibXML-2.0210/t/60error_prev_chain.t @@ -16,13 +16,11 @@ { my $parser = XML::LibXML->new(); - $parser->validation(0); - $parser->load_ext_dtd(0); eval { local $^W = 0; - $parser->parse_file('example/JBR-ALLENtrees.htm'); + $parser->parse_string('“ ”'); }; my $err = $@; @@ -31,7 +29,7 @@ if( $err && !ref($err) ) { plan skip_all => 'The local libxml library does not support errors as objects to $@'; } - plan tests => 1; + plan tests => 2; while (defined($err) && $count < 200) { @@ -44,6 +42,8 @@ # TEST ok ((!$err), "Reached the end of the chain."); + # TEST + is ($count, 3, "Correct number of errors reported") } =head1 COPYRIGHT & LICENSE