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 85 86 87 88 89 90 91 92
|
Description: fix or workaround test failures with newer HTML::Lint
- t/utils.t: add missing $lint->eof() and filter out "doc-tag-required" errors
- t/utf8.t: skip lint checks, HTML::Lint has Unicode problems:
https://github.com/petdance/html-lint/issues/11
Origin: vendor
Bug: https://rt.cpan.org/Ticket/Display.html?id=119731
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=119731
Author: gregor herrmann <gregoa@debian.org>
Last-Update: 2017-11-20
--- a/t/utf8.t
+++ b/t/utf8.t
@@ -24,14 +24,14 @@
1;
-use Test::More tests => 12;
+use Test::More tests => 6;
require "t/utils.pl";
{
my $simple = (show('simple_outs'));
ok($simple =~ m{^\s*$str\s*$}s);
# diag ($simple);
- ok_lint($simple);
+ #ok_lint($simple);
}
Template::Declare->buffer->clear;
@@ -39,21 +39,21 @@
my $simple = (show('double_outs'));
ok($simple =~ m{^\s*$str\s*$str\s*$}s);
# diag ($simple);
- ok_lint($simple);
+ #ok_lint($simple);
}
Template::Declare->buffer->clear;
{
my $simple = (show('tag_outs'));
ok($simple =~ m{^\s*<p>\s*$str\s*</p>\s*$}s);
- ok_lint($simple, 1);
+ #ok_lint($simple, 1);
}
Template::Declare->buffer->clear;
{
my $simple = (show('double_tag_outs'));
ok($simple =~ m{^\s*<p>\s*$str\s*</p>\s*<p>\s*$str\s*</p>\s*$}s);
- ok_lint($simple, 1);
+ #ok_lint($simple, 1);
}
Template::Declare->buffer->clear;
@@ -61,7 +61,7 @@
my $simple = (show('attr'));
ok($simple =~ m{^\s*<p\s+title="$str"\s*></p>\s*$}s);
# diag ($simple);
- ok_lint($simple);
+ #ok_lint($simple);
}
Template::Declare->buffer->clear;
@@ -69,7 +69,7 @@
my $simple = (show('attr_with_escape'));
ok($simple =~ m{^\s*<p\s+title="<$str>"\s*></p>\s*$}s);
#diag ($simple);
- ok_lint($simple);
+ #ok_lint($simple);
}
Template::Declare->buffer->clear;
--- a/t/utils.pl
+++ b/t/utils.pl
@@ -15,11 +15,13 @@
do {
local $SIG{__WARN__} = sub {}; # STFU HTML::Lint!
$lint->parse($html);
+ $lint->eof();
};
- # Collect the errors, ignore the invalid character errors when requested.
- my @errors = $ignore_chars
- ? grep { $_->errcode ne 'text-use-entity' } $lint->errors
- : $lint->errors;
+ # Collect the errors, ignore the doc-level errors, and invalid character errors when requested.
+ my @errors = grep { $_->errcode ne 'doc-tag-required' } $lint->errors;
+ @errors = $ignore_chars
+ ? grep { $_->errcode ne 'text-use-entity' } @errors
+ : @errors;
is( @errors, 0, "Lint checked clean" );
foreach my $error ( @errors ) {
diag( $error->as_string );
|