Skip to content
This repository has been archived by the owner on Apr 14, 2019. It is now read-only.

Problem filtering errors #16

Open
petdance opened this issue Dec 5, 2011 · 0 comments
Open

Problem filtering errors #16

petdance opened this issue Dec 5, 2011 · 0 comments
Labels

Comments

@petdance
Copy link
Owner

petdance commented Dec 5, 2011

Reported by [email protected], Oct 4, 2011

I expect the same error to be reported for all three calls to html_ok, because I consider it to be a structure error, and all three calls ask for structure errors to be reported.

Instead I see it reported only when no HTML::Lint object is passed to html_ok().

#!/usr/bin/perl -w

use Test::More tests => 7;

use_ok('Test::HTML::Lint');
use_ok('HTML::Lint::Error');

# some html I consider structurally defective
$html = '</body><tr><body>';

# ***Fails as expected.
html_ok($html, 'Check without an explicit HTML::Lint object');

# make an HTML::Lint that looks only for structure errors
$lint = new HTML::Lint( only_types => HTML::Lint::Error::STRUCTURE );
isa_ok($lint, HTML::Lint);
# ***Unexpectedly passes.
html_ok($lint, $html, 'Check with HTML::Lint object that looks only for structure errors');

# make an HTML::Lint that looks for all types of errors
$lint = new HTML::Lint( only_types => [HTML::Lint::Error::STRUCTURE, HTML::Lint::Error::FLUFF, HTML::Lint::Error::HELPER] );
isa_ok($lint, HTML::Lint);
# ***Unexpectedly passes.
html_ok($lint, $html, 'Check with HTML::Lint object that looks only for all errors');
@petdance petdance added the Bug label Dec 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant