petdance/html-lint — Issue #16: Problem filtering errors
Author: petdance
Created: 2011-12-05 23:07:43+00:00
State: open

Reported by apps@liturgiaetmusica.com, 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 = '

';

# ***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');
```