Test::Pod(3)
π Test::Pod(3) π
Okay bestie, so this is Test::Pod(3) from the User Contributed Perl Documentation, and it's literally all about checking POD files for errors. The way this module just gets it β iconic. π
πΈ VERSION πΈ
Version 1.52, periodt. That's the vibe check. β¨
π SYNOPSIS π
So Test::Pod lets you check the validity of a POD file, and report its results in standard Test::Simple fashion. It's giving very demure, very mindful testing energy. π«Ά
use Test::Pod tests => $num_tests;
pod_file_ok( $file, "Valid POD file" );
Module authors can include the following in a t/pod.t file and have Test::Pod automatically find and check all POD files in a module distribution:
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
You can also specify a list of files to check, using the all_pod_files() function supplied:
use strict;
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
my @poddirs = qw( blib script );
all_pod_files_ok( all_pod_files( @poddirs ) );
Or even (if you're running under Apache::Test):
use strict;
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
my @poddirs = qw( blib script );
use File::Spec::Functions qw( catdir updir );
all_pod_files_ok(
all_pod_files( map { catdir updir, $_ } @poddirs )
);
π¦ DESCRIPTION π¦
Check POD files for errors or warnings in a test file, using Pod::Simple to do the heavy lifting. No cap, Pod::Simple is the main character here β it's doing all the work so you don't have to. πͺ
π FUNCTIONS π
π«Ά pod_file_ok( FILENAME[, TESTNAME ] ) π«Ά
Okay so pod_file_ok() will okay the test if the POD parses correctly. Slay! But bestie, certain conditions are not reported yet, such as a file with no pod in it at all. So keep that in mind. π
When it fails, pod_file_ok() will show any pod checking errors as diagnostics. So you'll know exactly what went wrong, iykyk. π
The optional second argument TESTNAME is the name of the test. If it is omitted, pod_file_ok() chooses a default test name "POD test for FILENAME". Cute, right? π
π all_pod_files_ok( [@entries] ) π
Checks all the files under @entries for valid POD. It runs all_pod_files() on directories and assumes everything else to be a file to be tested. It calls the plan() function for you (one test for each file), so you can't have already called "plan". Not me warning you about that! π
If @entries is empty or not passed, the function finds all POD files in files in the blib directory if it exists, or the lib directory if not. A POD file matches the conditions specified below in "all_pod_files". Obsessed with the defaults, honestly. β¨
If you're testing a module, just make a t/pod.t:
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();
Returns true if all pod files are ok, or false if any fail. Simple as that, periodt. β
π§ all_pod_files( [@dirs] ) π§
Returns a list of all the POD files in @dirs and in directories below. If no directories are passed, it defaults to blib if blib exists, or else lib if not. Skips any files in CVS, .svn, .git and similar directories. See %Test::Pod::ignore_dirs for a list of them. Lowkey a vibe check for directories. π«
A POD file is:
- Any file that ends in
.pl,.PL,.pm,.pod,.psgior.t. - Any file that has a first line with a shebang and
"perl"on it. - Any file that ends in
.batand has a first line with"--*-Perl-*--"on it.
The order of the files returned is machine-dependent. If you want them sorted, you'll have to sort them yourself. No cap, that's on you bestie. π
π SUPPORT π
This module is managed in an open GitHub repository <http://github.com/perl-pod/test-pod/>. Feel free to fork and contribute, or to clone <git://github.com/perl-pod/test-pod.git> and send patches! Slay, open source queen behavior. π
Found a bug? Please post <http://github.com/perl-pod/test-pod/issues> or email <mailto:bug-test-pod@rt.cpan.org> a report! We love a good bug report, fr fr. π
π AUTHORS π
- David E. Wheeler
<david@justatheory.com>β Current maintainer. Main character energy. - Andy Lester
"<andy at petdance.com>"β Maintainer emeritus. Respect the legend. π«‘ - brian d foy β Original author. The OG, the blueprint. π
π ACKNOWLEDGEMENTS π
Thanks brian d foy for the original code, and to these folks for contributions:
- Andy Lester
- David E. Wheeler
- Paul Miller
- Peter Edwards
- Luca Ferrari
Y'all ate and left no crumbs. π β¨
π COPYRIGHT AND LICENSE π
Copyright 2006-2010, Andy Lester; 2010-2015 David E. Wheeler. Some Rights Reserved. Not all rights, just some β iconic. π
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. So go off, bestie. π«Ά
That's the whole vibe check! This page is from perl v5.42.0, dated 2018-04-20, and it's Test::Pod(3) β now go check those POD files and slay. πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Pod 1.52-160000.2.2 Β· Artistic-2.0 OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms