Test::Version(3pm)
β¨ Test::Version β the vibe check for your module versions β¨
okay bestie, so like. this is Test::Version, a Perl module from the User Contributed Perl Documentation section (that's the 3pm girlies π
). she's giving "one stop shop for checking your versions across your dist are sane" energy, and honestly? iconic.
version 2.09 β that's the VERSION section, keep up π
πΈ SYNOPSIS πΈ
here's how you actually use her, fr fr:
use Test::More;
use Test::Version 1.001001 qw( version_all_ok ), {
is_strict => 0,
has_version => 1,
consistent => 1,
};
# test blib or lib by default
version_all_ok();
done_testing;
π DESCRIPTION π
so the goal of this module? being a one stop shop for checking that your versions across your dist are sane. periodt.
π¨ bestie listen β please make sure you use version 0.04 or later only, because earlier versions are old code and may not work correctly. not me warning you twice.
current feature list, let's go:
- module has a version β tests to insure that all modules checked have a VERSION defined. she can replace
Test::HasVersion, slay. - module has a valid version β tests to insure that all versions are valid, according to the rules of the version method
is_lax. to quote:
the lax criteria corresponds to what is currently allowed by the version parser. all of the following formats are acceptable for dotted-decimal format strings:
v1.2
1.2345.6
v1.23_4
1.2345
1.2345_01
if you want to limit yourself to a much more narrow definition of what a version string constitutes, is_strict() is limited to version strings like the following list:
v1.234.5
2.3456
you can cause your tests to fail if not strict by setting is_strict to 1 π«Ά
π¦ FUNCTIONS π¦
version_ok
version_ok( $filename, [ $name ] );
test a single .pm file by passing a path to the function. checks if the module has a version, and that it is valid with is_lax. one file, one vibe check, easy. β¨
version_all_ok
version_all_ok( [ $directory, [ $name ]] );
test all modules in a directory with version_ok. by default it will check blib or lib if you haven't passed it a directory. she's thorough like that π
π CONFIGURATION AND ENVIRONMENT π
has_version
use Test::Version qw( version_all_ok ), { has_version => 0 };
allows disabling whether a module has to have a version. if set to 0, version tests will be skipped in any module where no version is found.
ngl, it really doesn't make sense to use with just version_ok.
is_strict
use Test::Version { is_strict => 1 };
this allows enabling of versions is_strict checks to ensure that your version is strict. no lax girlies allowed π
consistent
use Test::Version { consistent => 1 };
check if every module has the same version number. matching outfits, but for version numbers π
ignore_unindexable
use Test::Version { ignore_unindexable => 0};
if you have at least Module::Metadata v1.000020, Test::Version will by default skip any files not considered is_indexable.
filename_match
use Test::Version 2.0 { filename_match => [qr{Foo/Bar.pm$}] };
only test files that match the given pattern. pattern may be a list of strings, regular expressions or code references. the filename will match if it matches one or more patterns. here's the breakdown:
- string β the file matches if it matches the pattern string exactly.
- regular expression β the file matches if it matches the regular expression.
- code reference β the file matches if the code reference returns a true value. the filename is passed in as the only argument to the code reference.
multiple
use Test::Version 2.02 { multiple => 1 };
test each version for each package if multiple packages are found in a file. yes ma'am, every single one π
π SEE ALSO π
the goal is to have the functionality of all of these:
Test::HasVersionTest::ConsistentVersionTest::GreaterVersion
if you are using Dist::Zilla there is a plugin:
Dist::Zilla::Plugin::Test::Version
π BUGS π
please report any bugs or feature requests on the bugtracker website <https://github.com/plicease/test-version/issues>
when submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. help us help you bestie π«Ά
πΈ CONTRIBUTORS πΈ
these legends really said "we're built different":
- Damyan Ivanov <dmn@debian.org>
- Dave Rolsky <autarch@urth.org>
- Gabor Szabo <gabor@szabgab.com>
- Karen Etheridge <ether@cpan.org>
- Michael G. Schwern <schwern@pobox.com>
- Mike Doherty <doherty@cs.dal.ca>
- particle <particle@cpan.org>
π AUTHORS π
- Graham Ollis <plicease@cpan.org>
- Caleb Cushing <xenoterracide@gmail.com>
π COPYRIGHT AND LICENSE π
this software is Copyright (c) 2018 by Caleb Cushing.
this is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
and that's the whole page, bestie!! β¨ this was perl v5.36.0, dated 2022-11-29, and it's the Test::Version(3pm) manual β go forth and make your versions sane, you absolute icon ππ¦
π¦ where this page comes from
- debian bookworm: libtest-version-perl 2.09-2 Β· Artistic-2.0
- debian trixie: libtest-version-perl 2.09-2 Β· Artistic-2.0
- ubuntu noble: libtest-version-perl 2.09-2 Β· Artistic-2.0
- ubuntu resolute: libtest-version-perl 2.09-2 Β· Artistic-2.0
- ubuntu stonking: libtest-version-perl 2.09-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms