Test::...::Tidy5(3pm)

πŸ’– NAME πŸ’–

Test::HTML::Tidy5 β€” it's a Test::More-style wrapper around HTML::Tidy5, bestie. Like, it wraps the tidy and lets you test with it. Iconic behavior honestly.


✨ VERSION ✨

Version 1.06 πŸŽ€ (yes, the number matters, don't @ me)


πŸ¦‹ SYNOPSIS πŸ¦‹

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

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

Look at her go. Four tests, one cute little call, zero chaos. πŸ’…


🌸 DESCRIPTION 🌸

Okay so, this module hands you a few convenience methods for testing exception based code. It's built with Test::Builder, and it plays so happily with Test::More and friends β€” like the friend group is thriving, no drama. 🫢

And if you're not already familiar with Test::More? bestie, now would be the time to go take a look. Not me nagging, just saying. πŸ‘€


πŸ‘‘ EXPORT πŸ‘‘

"html_tidy_ok" β€” that's what you get. πŸ’–


🧚 html_tidy_ok( [$tidy, ] $html, $name )

Checks to see if $html is a valid HTML document. Vibe check, but for markup. ✨

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

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" );
Not me leaving that trailing ' in the example exactly as it was. Copy it character for character, bestie, we don't fix the original, we respect the original. πŸ’€

πŸŽ€ html_fragment_tidy_ok( [$tidy, ] $html, $name )

Works the same as "html_tidy_ok", but first wraps it up an HTML document. Wraps it up, like a little gift. 🎁

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. Tiny fragment, full main character energy. πŸ”₯


πŸ’€ 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/. I'm so serious. Do not. The old repo does not want your bug reports, she's retired, let her rest. πŸ™ˆ

Copyright 2005-2018 Andy Lester.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0.

http://www.opensource.org/licenses/Artistic-2.0

Please note that these modules are not products of or supported by the employers of the various contributors to the code. Just so we're clear. ⭐


πŸ’œ AUTHOR πŸ’œ

Andy Lester, "andy@petdance.com" β€” go say hi, respectfully. 🫢


okay that's the whole page, and yes it's Perl documentation, section 3pm, perl v5.42.3, dated 2026-08-19. Slay. Go write some tests, bestie, you got this. πŸ’…βœ¨

πŸ“¦ where this page comes from