#!perl -T use warnings; use strict; use Test::More tests => 3; use HTML::Tidy; my $html = join '', ; my @expected = split /\n/, q{ - (1:1) Warning: missing declaration - (2:5) Warning: too many title elements in }; my $tidyversion = HTML::Tidy->tidyp_version; if ($tidyversion =~ /^5.006/) { @expected = split /\n/, q{ - (1:1) Warning: missing declaration - (2:5) Warning: too many title elements in }; } chomp @expected; shift @expected; # First one's blank my $tidy = HTML::Tidy->new; isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); my $rc = $tidy->parse( '-', $html ); ok( $rc, 'Parsed OK' ); my @returned = map { $_->as_string } $tidy->messages; s/[\r\n]+\z// for @returned; is_deeply( \@returned, \@expected, 'Matching warnings' ); __DATA__ <HTML> <HEAD> <TITLE>Test stuff As if one title isn't enough

This is my paragraph