1
Subject: Fix tests with perl 5.14
2
Author: gregor herrmann <gregoa@debian.org>
3
Bug-Debian: http://bugs.debian.org/636520
4
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=70099
6
--- libtest-html-content-perl-0.08.orig/t/08-errors.comment.t
7
+++ libtest-html-content-perl-0.08/t/08-errors.comment.t
9
plan skip_all => "Test::Builder::Tester required for testing error messages";
13
+# Accept both old and new-style stringification
14
+my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? "^" : "-xism";
17
# Test that each exported function fails as documented
21
test_diag("Saw '<!-- hidden massage -->'",
22
"Saw '<!-- hidden massage -->'",
23
- "Expected no comment like '(?-xism:hidden m.ssage)'");
24
+ "Expected no comment like '(?$modifiers:hidden m.ssage)'");
26
no_comment("<!-- hidden massage --><!-- hidden massage -->",
27
qr"hidden m.ssage","Comment failure (two comments that shouldn't exist do)");
30
test_diag("Saw '<!-- hidden massage -->'",
31
"Saw '<!-- hidden massage -->'",
32
- "Expected exactly 3 comments like '(?-xism:hidden m.ssage)'");
33
+ "Expected exactly 3 comments like '(?$modifiers:hidden m.ssage)'");
35
comment_count("<!-- hidden massage --><!-- hidden massage -->",
36
qr"hidden m.ssage",3,"Comment failure (too few comments)");
39
test_diag("Saw '<!-- hidden massage -->'",
40
"Saw '<!-- hidden massage -->'",
41
- "Expected exactly 1 comments like '(?-xism:hidden m.ssage)'");
42
+ "Expected exactly 1 comments like '(?$modifiers:hidden m.ssage)'");
44
comment_count("<!-- hidden massage --><!-- hidden massage -->",
45
qr"hidden m.ssage",1,"Comment failure (too few comments)");
48
--- libtest-html-content-perl-0.08.orig/t/07-errors.link.t
49
+++ libtest-html-content-perl-0.08/t/07-errors.link.t
55
+# Accept both old and new-style stringification
56
+my $modifiers = (qr/foobar/ =~ /\Q(?^/) ? "^" : "-xism";
59
# Test that each exported function fails as documented
60
test_out("not ok 1 - Link failure (no links)");
63
if ($Test::HTML::Content::can_xpath eq 'XML::LibXML') {
64
test_diag("Expected to find no <a> tag(s) matching",
65
- " href = (?-xism:.)",
66
+ " href = (?$modifiers:.)",
68
' <a href="http://www.foo.com">foo</a>',
69
' <a href="index.html">Home</a>');
71
test_diag("Expected to find no <a> tag(s) matching",
72
- " href = (?-xism:.)",
73
+ " href = (?$modifiers:.)",
75
" <a href='http://www.foo.com'>",
76
" <a href='index.html'>");
79
if ($Test::HTML::Content::can_xpath eq 'XML::LibXML') {
80
test_diag("Expected to find exactly 3 <a> tag(s) matching",
81
- " href = (?-xism:.)",
82
+ " href = (?$modifiers:.)",
84
' <a href="http://www.foo.com">foo</a>',
85
' <a href="index.html">Home</a>');
87
test_diag("Expected to find exactly 3 <a> tag(s) matching",
88
- " href = (?-xism:.)",
89
+ " href = (?$modifiers:.)",
91
" <a href='http://www.foo.com'>",
92
" <a href='index.html'>");
95
if ($Test::HTML::Content::can_xpath eq 'XML::LibXML') {
96
test_diag("Expected to find exactly 3 <a> tag(s) matching",
97
- " href = (?-xism:.)",
98
+ " href = (?$modifiers:.)",
100
' <a href="http://www.bar.com">bar</a>',
101
' <a href="http://www.dot.com">.</a>',
103
' <a href="index.html">Home</a>');
105
test_diag("Expected to find exactly 3 <a> tag(s) matching",
106
- " href = (?-xism:.)",
107
+ " href = (?$modifiers:.)",
109
" <a href='http://www.bar.com'>",
110
" <a href='http://www.dot.com'>",