Test::XML::SAX(3pm)
π Test::XML::SAX β the manual, but make it cute π
okay so bestie, welcome to Test::XML::SAX, a little Perl module from the User Contributed Perl Documentation corner of the world, and its whole entire job is: testing XML::SAX handlers. that's it. that's the vibe. β¨
πΈ SYNOPSIS πΈ
use Test::XML::SAX tests => 1;
use My::XML::Filter;
my $handler = My::XML::Filter->new;
test_sax( $handler, '<foo />', '<bar/>', 'translates foo to bar' );
# ... In Another File ...
use Test::XML::SAX; use My::XML::Filter;
sub do_tests {
my $handler = My::XML::Filter->new;
test_sax( $handler, '<foo />', '<bar/>', 'translates foo to bar' );
}
test_all_sax_parsers( \&do_tests, 1 );
like, look at her go π«Ά she's testing a filter, then she's testing that same filter across every parser you have installed. main character behaviour, honestly.
π DESCRIPTION π
This module is for testing XML::SAX handlers. that's the whole summary. no notes. periodt. π
β¨ FUNCTIONS β¨
All functions are exported. every single one of them just shows up in your namespace like it pays rent there. no use gymnastics needed, no cap. π
π test_sax ( HANDLER, INPUT, EXPECTED [, TESTNAME ] )
This function will process INPUT using HANDLER, and compare the result with EXPECTED.
TESTNAME can optionally be used to name the test in the output β and bestie, it is a good idea. name your tests. future you will be obsessed with past you for it. πΈ
π test_all_sax_parsers ( SUB [, NUMTESTS ] )
This function will repeat a set of tests for all installed SAX parsers. SUB must be a coderef to run a series of tests. NUMTESTS is the number of tests inside SUB.
β οΈ NB: You must not issue a plan toTest::Moreif you call this function! The plan will be set for you, according to the number of parsers installed andNUMTESTS. This also means that you must not have any tests outside ofSUBor you will get an error. fr fr, do not fight the plan, the plan fights back. π
When SUB is called, it will be passed two arguments: the name of the parser being used, and the number of tests. It can use this information to decide whether or not to skip this set of tests. so like, if a parser is giving nothing energy, you can respectfully skip. π
π¦ SEE ALSO π¦
Test::MoreTest::XMLXML::SAX
the whole friend group, honestly. go say hi. π
π AUTHOR π
Dominic Mitchell, <cpan2 (at) semantico.com>
π COPYRIGHT AND LICENSE π
Copyright 2002 by semantico
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, bestie β you're officially fluent in Test::XML::SAX π
β¨
this was brought to you by perl v5.34.0, dated 2022-06-18 β the original Test::XML::SAX(3pm) footer energy, but make it a sign-off. mwah. π
π¦ where this page comes from
- debian bookworm: libtest-xml-perl 0.08-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-xml-perl 0.08-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-xml-perl 0.08-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms