Update tests for tidy-html 5.8.0 #14
https://github.com/petdance/html-tidy5/pull/14
diff --git a/t/drop-empty-elements.t b/t/drop-empty-elements.t
index 531e5fa..b2e83f9 100644
--- a/t/drop-empty-elements.t
+++ b/t/drop-empty-elements.t
@@ -32,11 +32,14 @@ subtest 'default constructor warns about empty spans' => sub {
$tidy->parse( 'test', $html );
messages_are( $tidy,
- [ 'test (7:9) Warning: trimming empty ' ],
+ [
+ 'test (4:9) Warning: blank \'title\' element',
+ 'test (7:9) Warning: trimming empty '
+ ],
);
};
-subtest 'drop_empty_elements => 1 gives message' => sub {
+subtest 'drop_empty_elements => 2 gives message' => sub {
plan tests => 2;
my $tidy = HTML::Tidy5->new( { drop_empty_elements => 1 } );
@@ -44,7 +47,10 @@ subtest 'drop_empty_elements => 1 gives message' => sub {
$tidy->parse( 'test', $html );
messages_are( $tidy,
- [ 'test (7:9) Warning: trimming empty ' ],
+ [
+ 'test (4:9) Warning: blank \'title\' element',
+ 'test (7:9) Warning: trimming empty '
+ ],
);
};
@@ -55,7 +61,11 @@ subtest 'drop_empty_elements => 0 gives no messages' => sub {
isa_ok( $tidy, 'HTML::Tidy5' );
$tidy->parse( 'test', $html );
- messages_are( $tidy, [] );
+ messages_are( $tidy,
+ [
+ 'test (4:9) Warning: blank \'title\' element',
+ ],
+ );
};
exit 0;
diff --git a/t/html_fragment_tidy_ok.t b/t/html_fragment_tidy_ok.t
index 15c04ca..1f74faa 100644
--- a/t/html_fragment_tidy_ok.t
+++ b/t/html_fragment_tidy_ok.t
@@ -44,12 +44,15 @@ HTML
test_test( $msg );
$msg = 'html_fragment_tidy_ok can handle it';
- test_out( "ok 1 - $msg" );
+ test_out( "not ok 1 - $msg" );
+ test_fail( +4 );
+ test_diag( "Errors: $msg" );
+ test_diag( '(-2:9) Warning: blank \'title\' element' );
+ test_diag( '1 message on the page' );
html_fragment_tidy_ok( $html, $msg );
test_test( $msg );
};
-
subtest 'html_fragment_tidy_ok gets the same errors as html_tidy_ok' => sub {
plan tests => 2;
@@ -76,11 +79,12 @@ HTML
# Note that the line numbers are the same between html_tidy_ok and html_fragment_tidy_ok.
$msg = 'html_fragment_tidy_ok on sloppy doc';
test_out( "not ok 1 - $msg" );
- test_fail( +5 );
+ test_fail( +6 );
test_diag( "Errors: $msg" );
test_diag( '(2:59) Warning: discarding unexpected ' );
+ test_diag( '(-2:9) Warning: blank \'title\' element' );
test_diag( '(3:5) Warning: lacks "alt" attribute' );
- test_diag( '2 messages on the page' );
+ test_diag( '3 messages on the page' );
html_fragment_tidy_ok( $html, $msg );
test_test( $msg );
};
diff --git a/t/html_tidy_ok.t b/t/html_tidy_ok.t
index 07cfbfd..d8afd9b 100644
--- a/t/html_tidy_ok.t
+++ b/t/html_tidy_ok.t
@@ -41,9 +41,19 @@ subtest 'html_tidy_ok without errors' => sub {