.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Test::Version 3pm" .TH Test::Version 3pm "2016-09-22" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Version \- Check to see that version's in modules are sane .SH "VERSION" .IX Header "VERSION" version 2.05 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& 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; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module's goal is to be a one stop shop for checking to see that your versions across your dist are sane. Please ensure that you use version \f(CW0.04\fR or later only, as earlier versions are old code and may not work correctly. Current feature list: .IP "module has a version" 4 .IX Item "module has a version" Tests to insure that all modules checked have a \s-1VERSION\s0 defined, Can replace Test::HasVersion .IP "module has a valid version" 4 .IX Item "module has a valid version" Tests to insure that all versions are valid, according to the rules of version method \f(CW\*(C`is_lax\*(C'\fR. To quote: .Sp \&\fIThe lax criteria corresponds to what is currently allowed by the version parser. All of the following formats are acceptable for dotted-decimal formats strings:\fR .Sp .Vb 5 \& v1.2 \& 1.2345.6 \& v1.23_4 \& 1.2345 \& 1.2345_01 .Ve .Sp \&\fIIf you want to limit yourself to a much more narrow definition of what a version string constitutes, \fIis_strict()\fI is limited to version strings like the following list:\fR .Sp .Vb 2 \& v1.234.5 \& 2.3456 .Ve .Sp you can cause your tests to fail if not strict by setting is_strict to \&\f(CW1\fR .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "version_ok" .IX Subsection "version_ok" .Vb 1 \& version_ok( $filename, [ $name ] ); .Ve .PP Test a single \f(CW\*(C`.pm\*(C'\fR file by passing a path to the function. Checks if the module has a version, and that it is valid with \f(CW\*(C`is_lax\*(C'\fR. .SS "version_all_ok" .IX Subsection "version_all_ok" .Vb 1 \& version_all_ok( [ $directory, [ $name ]] ); .Ve .PP Test all modules in a directory with \f(CW\*(C`version_ok\*(C'\fR. By default it will check \&\f(CW\*(C`blib\*(C'\fR or \f(CW\*(C`lib\*(C'\fR if you haven't passed it a directory. .SH "CONFIGURATION AND ENVIRONMENT" .IX Header "CONFIGURATION AND ENVIRONMENT" .SS "has_version" .IX Subsection "has_version" .Vb 1 \& use Test::Version qw( version_all_ok ), { has_version => 0 }; .Ve .PP 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. .PP really doesn't make sense to use with just version_ok .SS "is_strict" .IX Subsection "is_strict" .Vb 1 \& use Test::Version { is_strict => 1 }; .Ve .PP this allows enabling of versions \f(CW\*(C`is_strict\*(C'\fR checks to ensure that your version is strict. .SS "consistent" .IX Subsection "consistent" .Vb 1 \& use Test::Version { consistent => 1 }; .Ve .PP Check if every module has the same version number. .SS "ignore_unindexable" .IX Subsection "ignore_unindexable" .Vb 1 \& use Test::Version { ignore_unindexable => 0}; .Ve .PP if you have at least Module::Metadata v\f(CW1.000020\fR Test::Version will by default skip any files not considered is_indexable .SS "filename_match" .IX Subsection "filename_match" .Vb 1 \& use Test::Version 2.0 { filename_match => [qr{Foo/Bar.pm$}] }; .Ve .PP 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. .IP "string" 4 .IX Item "string" The file matches if it matches the pattern string exactly. .IP "regular expression" 4 .IX Item "regular expression" The file matches if it matches the regular expression. .IP "code reference" 4 .IX Item "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. .SS "multiple" .IX Subsection "multiple" .Vb 1 \& use Test::Version 2.02 { multiple => 1 }; .Ve .PP Test each version for each package if multiple packages are found in a file. .SH "SEE ALSO" .IX Header "SEE ALSO" The goal is to have the functionality of all of these. .IP "Test::HasVersion" 4 .IX Item "Test::HasVersion" .PD 0 .IP "Test::ConsistentVersion" 4 .IX Item "Test::ConsistentVersion" .IP "Test::GreaterVersion" 4 .IX Item "Test::GreaterVersion" .PD .PP If you are using Dist::Zilla there is a plugin .IP "Dist::Zilla::Plugin::Test::Version" 4 .IX Item "Dist::Zilla::Plugin::Test::Version" .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website https://github.com/plicease/test\-version/issues .PP 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. .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 Dave Rolsky .IP "\(bu" 4 Gabor Szabo .IP "\(bu" 4 Karen Etheridge .IP "\(bu" 4 Michael G. Schwern .IP "\(bu" 4 Mike Doherty .IP "\(bu" 4 particle .SH "AUTHORS" .IX Header "AUTHORS" .IP "\(bu" 4 Graham Ollis .IP "\(bu" 4 Caleb Cushing .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2016 by Caleb Cushing. .PP This is free software, licensed under: .PP .Vb 1 \& The Artistic License 2.0 (GPL Compatible) .Ve