Skip Menu |

This queue is for tickets about the Template-Declare CPAN distribution.

Report information
The Basics
Id: 119731
Status: open
Priority: 0/
Queue: Template-Declare

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: gregoa [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.47
Fixed in: (no value)



Subject: Lint tests started to fail (with latest HTML::Lint?)
My smoker systems started to report failures: ... # Failed test 'Lint checked clean' # at t/utils.pl line 23. # got: '1' # expected: '0' # (3:18) The eof() method has not been called on this file. # Failed test 'Lint checked clean' # at t/utils.pl line 23. # got: '1' # expected: '0' # (3:15) The eof() method has not been called on this file. # Failed test 'Lint checked clean' # at t/utils.pl line 23. # got: '1' # expected: '0' # (3:15) The eof() method has not been called on this file. # Failed test 'Lint checked clean' # at t/utils.pl line 23. # got: '1' # expected: '0' # (3:15) The eof() method has not been called on this file. # Failed test 'Lint checked clean' # at t/utils.pl line 23. # got: '1' # expected: '0' # (3:15) The eof() method has not been called on this file. # Looks like you failed 5 tests of 30. t/aliasing.t ................ Dubious, test returned 5 (wstat 1280, 0x500) Failed 5/30 subtests (etc) ... This is probably caused by recent versions of HTML::Lint, see https://metacpan.org/source/PETDANCE/HTML-Lint-2.26/Changes#L30
There are at least 3 issues, from what I can see: - in t/utils.t: * missing $lint->eof() * <html>, <head>, <title> and <body>, aka "doc-level errors" or "doc-tag-required", need to be ignored too Both of these issues could fixed by using Test::HTML::Lint's html_fragment_ok() instead of the hand-crafted t/utils.t - or maybe not because of the text-use-entity issues (which could possible be removed, as it's only used in t/utf8.t -->) The third issue is that t/utf8.t fails, apparently HTML::Lint doesn't like unicode: https://github.com/petdance/html-lint/issues/11 Attached is a patch with rather minimal changes in t/utils.t and commenting out the lint stuff from t/utf8.8
Subject: html-lint.patch
--- 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="&lt;$str&gt;"\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 );
On Fri Jan 06 03:02:27 2017, SREZIC wrote: Show quoted text
> My smoker systems started to report failures: > > ... > # Failed test 'Lint checked clean' > # at t/utils.pl line 23. > # got: '1' > # expected: '0' > # (3:18) The eof() method has not been called on this file. > > # Failed test 'Lint checked clean' > # at t/utils.pl line 23. > # got: '1' > # expected: '0' > # (3:15) The eof() method has not been called on this file. > > # Failed test 'Lint checked clean' > # at t/utils.pl line 23. > # got: '1' > # expected: '0' > # (3:15) The eof() method has not been called on this file. > > # Failed test 'Lint checked clean' > # at t/utils.pl line 23. > # got: '1' > # expected: '0' > # (3:15) The eof() method has not been called on this file. > > # Failed test 'Lint checked clean' > # at t/utils.pl line 23. > # got: '1' > # expected: '0' > # (3:15) The eof() method has not been called on this file. > # Looks like you failed 5 tests of 30. > t/aliasing.t ................ > Dubious, test returned 5 (wstat 1280, 0x500) > Failed 5/30 subtests > (etc) > ... > > This is probably caused by recent versions of HTML::Lint, see > https://metacpan.org/source/PETDANCE/HTML-Lint-2.26/Changes#L30
Failures still present when tested against perl-5.31.0 on FreeBSD-12.