# $Id: 06detailed.t 700 2007-08-07 20:52:52Z struan $ use Test::More; use WebService::Validator::HTML::W3C; my $test_num = 5; if ( $ENV{ 'TEST_AUTHOR' } ) { $test_num = 6; } plan tests => $test_num; my $v = WebService::Validator::HTML::W3C->new( http_timeout => 10, detailed => 1, ); SKIP: { skip "XML::XPath not installed", $test_num if -f 't/SKIPXPATH'; ok($v, 'object created'); if ( $ENV{ 'TEST_AUTHOR' } ) { my $r = $v->validate('http://exo.org.uk/code/www-w3c-validator/invalid.html'); unless ($r) { if ($v->validator_error eq "Could not contact validator") { skip "failed to contact validator", 5; } } ok ($r, 'page validated'); } else { $v->num_errors( 1 ); $v->_content( qq{ http://exo.org.uk/code/www-w3c-validator/invalid.html Sat Oct 4 14:53:18 2003 Apache/1.3.28 (Unix) (Red-Hat/Linux) mod_ssl/2.8.15 OpenSSL/0.9.7a PHP/4.0.6 mod_perl/1.26 FrontPage/4.0.4.3 256 utf-8 -//W3C//DTD XHTML 1.0 Strict//EN <em>Note</em>: The Validator XML support has <a href="http://openjade.sf.net/doc/xml.htm" title="Limitations in Validator XML support">some limitations</a>. This interface is highly experimental and the output *will* change -- probably even several times -- before finished. Do *not* rely on it! See http://validator.w3.org:8001/docs/users.html#api-warning end tag for "div" omitted, but OMITTAG NO was specified start tag was here } ); } my $err = $v->errors->[0]; isa_ok($err, 'WebService::Validator::HTML::W3C::Error'); is($err->line, 11, 'Correct line number'); is($err->col, 6, 'Correct column'); like($err->msg, qr/end tag for "div" omitted, but OMITTAG NO was specified/, 'Correct message'); }