Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HTML::Tidy and Test::HTML::Tidy

#!/usr/bin/perl
use strict;
use warnings;

use Test::More tests => 2;
use Test::HTML::Tidy;
use LWP::Simple qw(get);


my $home = get 'http://localhost:8080/';
ok $home, 'There is a response';
html_tidy_ok $home, 'HTML OK';

$ perl examples/www/static_tidy.t
1..2
ok 1 - There is a response
not ok 2 - HTML OK
#   Failed test 'HTML OK'
#   in examples/www/static_tidy.t at line 11.
# Messages: HTML OK
# examples/www/static_tidy.t (1:1) Warning: missing <!DOCTYPE> declaration
# Looks like you failed 1 test of 2.