POE::Test::Loops(3pm)
β¨ NAME β¨
POE::Test::Loops β it's the reusable test suite for all you POE::Loop authors out there π (this is the POE::Test::Loops(3pm) page, from the User Contributed Perl Documentation, bestie π«Ά)
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, copy-paste ready:
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use POE::Test::Loops;
my ($dir_base, $flag_help, @loop_modules, $flag_verbose);
my $result = GetOptions(
'dirbase=s' => \$dir_base,
'loop=s' => \@loop_modules,
'verbose' => \$flag_verbose,
'help' => \$flag_help,
);
if (
!$result or !$dir_base or $flag_help or !@loop_modules
) {
die(
"$0 usage:\n",
" --dirbase DIR (required) base directory for tests\n",
" --loop MODULE (required) loop modules to test\n",
" --verbose show some extra output\n",
" --help you're reading it\n",
);
}
POE::Test::Loops::generate($dir_base, \@loop_modules, $flag_verbose);
exit 0;
no cap, that's the whole thing π
π¦ DESCRIPTION π¦
POE::Test::Loops has literally one function. One. Iconic minimalism. β¨ That function is generate(), and what it does is generate all the loop tests for one or more POE::Loop subclasses. So if you're out here writing your own POE::Loop subclass, this is the bestie that makes your tests for you π
And that SYNOPSIS example up there? That's a version of poe-gen-tests, which is a stand-alone utility that generates the actual tests. poe-gen-tests also documents the whole POE::Test::Loops system in wayyy more detail, so go read that if you want the full lore π
π FUNCTIONS π
π generate( $DIRBASE, @LOOPS, $VERBOSE )
Generates the loop tests. That's the job. That's the whole job π«‘
$DIRBASEβ the (relative) directory where a subdirectory gets created for each of the@LOOPS. Note the relative part, bestie, it's right there in the original, don't come for me π\@LOOPSβ arrayref of the loop modules you're testing, one subdirectory each π$VERBOSEβ if you set it to a TRUE value, it prints some progress reporting. so you get to watch it cook π
like this:
POE::Test::Loops::generate(
"./t",
[ "POE::Loop::Yours" ],
1,
);
π SEE ALSO π
Go look at POE::Loop and poe-gen-tests. that's the whole list, fr fr π
π AUTHOR & COPYRIGHT π
See poe-gen-tests. (yes that's really all it says, the lore lives over there β¨)
and that's the tea, bestie β this page is perl v5.36.0, dated 2022-11-19, and it's the POE::Test::Loops(3pm) manual. go forth and generate those tests, you absolute main character ππ
π¦ where this page comes from
- debian bookworm: libpoe-test-loops-perl 1.360-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpoe-test-loops-perl 1.360-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpoe-test-loops-perl 1.360-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpoe-test-loops-perl 1.360-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-test-loops-perl 1.360-3 Β· 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