.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Test::HTML::Lint 3pm" .TH Test::HTML::Lint 3pm "2018-09-12" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::HTML::Lint \- Test::More\-style wrapper around HTML::Lint .SH "VERSION" .IX Header "VERSION" Version 2.32 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Test::HTML::Lint tests => 4; \& \& my $table = build_display_table(); \& html_ok( $table, \*(AqBuilt display table properly\*(Aq ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a few convenience methods for testing exception based code. It is built with Test::Builder and plays happily with Test::More and friends. .PP If you are not already familiar with Test::More now would be the time to go take a look. .SH "EXPORT" .IX Header "EXPORT" \&\f(CW\*(C`html_ok\*(C'\fR .ie n .SS "html_ok( [$lint, ] $html, $name )" .el .SS "html_ok( [$lint, ] \f(CW$html\fP, \f(CW$name\fP )" .IX Subsection "html_ok( [$lint, ] $html, $name )" Checks to see if \f(CW$html\fR is a valid \s-1HTML\s0 document, including checks for having \f(CW\*(C`\*(C'\fR, \f(CW\*(C`\*(C'\fR, \f(CW\*(C`>\*(C'\fR and \&\f(CW\*(C`<body>\*(C'\fR tags. .PP If you're checking something that is only a fragment of an \s-1HTML\s0 document, use \f(CW\*(C`html_fragment_ok()\*(C'\fR. .PP If you pass an HTML::Lint object, \f(CW\*(C`html_ok()\*(C'\fR will use that for its settings. .PP .Vb 2 \& my $lint = new HTML::Lint( only_types => STRUCTURE ); \& html_ok( $lint, $content, "Web page passes structural tests only" ); .Ve .PP Otherwise, it will use the default rules. .PP .Vb 1 \& html_ok( $content, "Web page passes ALL tests" ); .Ve .PP Note that if you pass in your own HTML::Lint object, \f(CW\*(C`html_ok()\*(C'\fR will clear its errors before using it. .ie n .SS "html_fragment_ok( [$lint, ] $html, $name )" .el .SS "html_fragment_ok( [$lint, ] \f(CW$html\fP, \f(CW$name\fP )" .IX Subsection "html_fragment_ok( [$lint, ] $html, $name )" Checks that \f(CW$fragment\fR is valid \s-1HTML,\s0 but not necessarily a valid \&\s-1HTML\s0 document. .PP For example, this is a valid fragment, but not a valid \s-1HTML\s0 document: .PP .Vb 3 \& <body> \& <p>Lorem ipsum</p> \& </body> .Ve .PP because it doesn't contain \f(CW\*(C`<html>\*(C'\fR and \f(CW\*(C`<head>\*(C'\fR tags. If you want to check that it is a valid document, use \f(CW\*(C`html_ok()\*(C'\fR. .PP If you pass an HTML::Lint object, \f(CW\*(C`html_fragment_ok()\*(C'\fR will use that for its settings. .PP .Vb 2 \& my $lint = new HTML::Lint( only_types => STRUCTURE ); \& html_fragment_ok( $lint, $content, \*(AqWeb page passes structural tests only\*(Aq ); .Ve .PP Otherwise, it will use the default rules. .PP .Vb 1 \& html_fragment_ok( $content, \*(AqFragment passes ALL tests\*(Aq ); .Ve .PP Note that if you pass in your own HTML::Lint object, \f(CW\*(C`html_fragment_ok()\*(C'\fR will clear its errors before using it. .SH "BUGS" .IX Header "BUGS" All bugs and requests are now being handled through GitHub. .PP .Vb 1 \& https://github.com/petdance/html\-lint/issues .Ve .PP \&\s-1DO NOT\s0 send bug reports to http://rt.cpan.org/. .SH "TO DO" .IX Header "TO DO" There needs to be a \f(CW\*(C`html_table_ok()\*(C'\fR to check that the \s-1HTML\s0 is a self-contained, well-formed table, and then a comparable one for \&\f(CW\*(C`html_page_ok()\*(C'\fR. .PP If you think this module should do something that it doesn't do at the moment please let me know. .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" Thanks to chromatic and Michael G Schwern for the excellent Test::Builder, without which this module wouldn't be possible. .PP Thanks to Adrian Howard for writing Test::Exception, from which most of this module is taken. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2005\-2018 Andy Lester. .PP This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0. .PP http://www.opensource.org/licenses/Artistic\-2.0 .PP Please note that these modules are not products of or supported by the employers of the various contributors to the code. .SH "AUTHOR" .IX Header "AUTHOR" Andy Lester, \f(CW\*(C`andy@petdance.com\*(C'\fR