Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
| 1 |
#!perl -T |
| 2 |
|
| 3 |
use warnings; |
| 4 |
use strict; |
| 5 |
|
| 6 |
use Test::More tests => 3; |
| 7 |
|
| 8 |
use HTML::Tidy; |
| 9 |
|
| 10 |
my $html = join '', <DATA>; |
| 11 |
|
| 12 |
my @expected = split /\n/, q{ |
| 13 |
- (1:1) Warning: missing <!DOCTYPE> declaration |
| 14 |
- (4:9) Warning: too many title elements in <head> |
| 15 |
}; |
| 16 |
chomp @expected; |
| 17 |
shift @expected; # First one's blank |
| 18 |
|
| 19 |
my $tidy = HTML::Tidy->new; |
| 20 |
isa_ok( $tidy, 'HTML::Tidy' ); |
| 21 |
$tidy->ignore( type => TIDY_INFO ); |
| 22 |
my $rc = $tidy->parse( '-', $html ); |
| 23 |
ok( $rc, 'Parsed OK' ); |
| 24 |
|
| 25 |
my @returned = map { $_->as_string } $tidy->messages; |
| 26 |
s/[\r\n]+\z// for @returned; |
| 27 |
is_deeply( \@returned, \@expected, 'Matching warnings' ); |
| 28 |
|
| 29 |
__DATA__ |
| 30 |
<HTML> |
| 31 |
<HEAD> |
| 32 |
<TITLE>Test stuff</TITLE> |
| 33 |
<TITLE>As if one title isn't enough</TITLE> |
| 34 |
</HEAD> |
| 35 |
<BODY BGCOLOR="white"> |
| 36 |
<P>This is my paragraph</P> |
| 37 |
</BODY> |
| 38 |
</HTML> |