Test::NoPlan(3pm)
π Test::NoPlan π
okay so bestie, welcome to Test::NoPlan, a lil Perl module from the User Contributed Perl Documentation collection. it's a whole vibe check for your test files, and honestly? you're gonna be obsessed. π¦
β¨ NAME β¨
Test::NoPlan β it checks your perl test files for 'no_plan' π
πΈ SYNOPSIS πΈ
so here's the tea, bestie: it's a really good idea to make sure you've defined how many tests should run inside each test script. why? because that way you catch the cases where your tests bomb out halfway through and you actually know how many tests never got run. iconique, right? so this module goes through all your test plan files and makes sure 'no_plan' is not being used. periodt. π
you can check, like, one single file:
use Test::NoPlan qw/ check_file_for_no_plan /;
use Test::More tests => 1;
check_file_for_no_plan('t/test.t');
or you can check literally all the files:
use Test::NoPlan qw/ all_plans_ok /;
all_plans_ok();
π EXPORT π
all_plans_ok({ options });
it searches for and checks all the *.t files chillin' in the current directory. the options (with their defaults shown, no surprises here) are:
topdir => '.'β the directory where the search begins, and it's relative to the top directory in the project (aka the place where theMakefile.PLorBuild.PLfile lives).check_files => qr/\.t$/xsmβ the regexp used to figure out which files get checked, so like, files ending in'.t'. heads up though: this only looks at the basename of the files, the path is excluded. πignore_files => qr/^\..*$/xsmβ the regexp used to figure out which files to ignore, aka the ones starting with'.'. and same deal as above: it only checks the basename, path is excluded.recurse => 0β recurse into any subdirectories. not done by default, bestie, you gotta ask for it.method => '<create|new>'[default:create] β this changes up the method by which the test object gets created. by default'create'is used, which is the correct move for test files that only contain the'all_plans_ok'test. but if you've got multiple tests living inside the same test file, then you should use'new'so that a single test object gets created and shared. sharing is caring fr fr π«Ά
get_file_list( { [ options ] } );
returns a list of the files that are gonna be checked β it uses the same options as "all_plans_ok". easy peasy. β¨
check_file_for_no_plan( $filename );
checks the file you hand it for instances of uncommented 'no_plan' usage. it returns 0 when there's a problem, and 1 when no problem was found. no cap. π―
π AUTHOR π
Duncan Ferguson, "< duncs@cpan.org >" β king behaviour, we love to see it. π
π BUGS π
pls pls pls report any bugs or feature requests to "bug-test-noplan at rt.cpan.org", or slide through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-NoPlan>. Duncan will get notified, and then you'll automatically get notified of progress on your bug as changes get made. it's giving teamwork. π«Ά
π SUPPORT π
you can find documentation for this module with the perldoc command:
perldoc Test::NoPlan
you can also go looking for info at:
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-NoPlan>
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Test-NoPlan>
- CPAN Ratings
<http://cpanratings.perl.org/d/Test-NoPlan>
- Search CPAN
<http://search.cpan.org/dist/Test-NoPlan/>
- Source code repository at GitHub
<http://github.com/duncs/perl-test-noplan>
β ACKNOWLEDGEMENTS β
(nothing listed here bestie β it's just vibes and empty space πΈ)
π COPYRIGHT & LICENSE π
Copyright 2009 Duncan Ferguson, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this one came from perl v5.42.0 and it's dated 2025-07-25 β go forth and make sure your test plans are immaculate, mwah π
β¨
π¦ where this page comes from
- fedora 43: perl-Test-NoPlan 0.0.6-39.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms