Subject: | t/35huge_mode.t fails with libxml2 < 2.7.0 |
Hi!
I found that t/35huge_mode.t test fails with libxml2 < 2.7.0:
# Failed test 'exception thrown during parse'
# at t/35huge_mode.t line 49.
# got: ''
# expected: anything else
# Failed test 'exception refers to entity reference loop'
# at t/35huge_mode.t line 50.
# ''
# doesn't match '(?^si:entity.*loop)'
# Looks like you failed 2 tests of 5.
t/35huge_mode.t ........................
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests
This happens because that XML_PARSE_HUGE option has been added to libxml2 from version 2.7.0.
I propose the following patch to solve the problem.
--
YOREEK
Subject: | 35huge_mode.t.patch |
diff -Nura XML-LibXML-2.0104-orig/t/35huge_mode.t XML-LibXML-2.0104/t/35huge_mode.t
--- XML-LibXML-2.0104-orig/t/35huge_mode.t 2013-04-13 22:33:58.000000000 +0300
+++ XML-LibXML-2.0104/t/35huge_mode.t 2013-09-03 02:23:51.267971120 +0300
@@ -9,10 +9,17 @@
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More;
use XML::LibXML;
+if (XML::LibXML::LIBXML_VERSION() < 20700) {
+ plan skip_all => "XML_PARSE_HUGE option not supported for libxml2 < 2.7.0";
+}
+else {
+ plan tests => 5;
+}
+
my $benign_xml = <<'EOF';
<?xml version="1.0"?>
<!DOCTYPE lolz [