logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test::HTML::Tidy5 - Test::More-style wrapper around HTML::Tidy5

Author

       Andy Lester, "andy@petdance.com"

perl v5.40.0                                       2024-10-20                             Test::HTML::Tidy5(3pm)

Bugs

       All bugs and requests are now being handled through GitHub.

           https://github.com/petdance/html-lint/issues

       DO NOT send bug reports to http://rt.cpan.org/.

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.

       If you are not already familiar with Test::More now would be the time to go take a look.

Export

       "html_tidy_ok"

   html_tidy_ok([$tidy,]$html,$name)
       Checks to see if $html is a valid HTML document.

       If you pass an HTML::Tidy5 object, html_tidy_ok() will use that for its settings.

           my $tidy = HTML::Tidy5->new( {config_file => 'path/to/config'} );
           $tidy->ignore( type => TIDY_WARNING, type => TIDY_INFO );
           html_tidy_ok( $tidy, $content, "Web page is OK, ignoring warnings and info' );

       Otherwise, it will use the default rules.

           html_tidy_ok( $content, "Web page passes ALL tests" );

   html_fragment_tidy_ok([$tidy,]$html,$name)
       Works the same as "html_tidy_ok", but first wraps it up an HTML document.  This is useful for when want
       to validate self-contained snippets of HTML, such as from templates or an HTML feed from a third party,
       and check that it is valid.

Name

       Test::HTML::Tidy5 - Test::More-style wrapper around HTML::Tidy5

Synopsis

           use Test::HTML::Tidy5 tests => 4;

           my $table = build_display_table();
           html_tidy_ok( $table, 'Built display table properly' );

Version

       Version 1.06

See Also