README
1NAME
2
3 Test::Version - Check to see that version's in modules are sane
4
5VERSION
6
7 version 2.09
8
9SYNOPSIS
10
11 use Test::More;
12 use Test::Version 1.001001 qw( version_all_ok ), {
13 is_strict => 0,
14 has_version => 1,
15 consistent => 1,
16 };
17
18 # test blib or lib by default
19 version_all_ok();
20
21 done_testing;
22
23DESCRIPTION
24
25 This module's goal is to be a one stop shop for checking to see that
26 your versions across your dist are sane. Please ensure that you use
27 version 0.04 or later only, as earlier versions are old code and may
28 not work correctly. Current feature list:
29
30 module has a version
31
32 Tests to insure that all modules checked have a VERSION defined, Can
33 replace Test::HasVersion
34
35 module has a valid version
36
37 Tests to insure that all versions are valid, according to the rules
38 of version method is_lax. To quote:
39
40 The lax criteria corresponds to what is currently allowed by the
41 version parser. All of the following formats are acceptable for
42 dotted-decimal formats strings:
43
44 v1.2
45 1.2345.6
46 v1.23_4
47 1.2345
48 1.2345_01
49
50 If you want to limit yourself to a much more narrow definition of
51 what a version string constitutes, is_strict() is limited to version
52 strings like the following list:
53
54 v1.234.5
55 2.3456
56
57 you can cause your tests to fail if not strict by setting is_strict
58 to 1
59
60FUNCTIONS
61
62 version_ok
63
64 version_ok( $filename, [ $name ] );
65
66 Test a single .pm file by passing a path to the function. Checks if the
67 module has a version, and that it is valid with is_lax.
68
69 version_all_ok
70
71 version_all_ok( [ $directory, [ $name ]] );
72
73 Test all modules in a directory with version_ok. By default it will
74 check blib or lib if you haven't passed it a directory.
75
76CONFIGURATION AND ENVIRONMENT
77
78 has_version
79
80 use Test::Version qw( version_all_ok ), { has_version => 0 };
81
82 Allows disabling whether a module has to have a version. If set to 0
83 version tests will be skipped in any module where no version is found.
84
85 really doesn't make sense to use with just version_ok
86
87 is_strict
88
89 use Test::Version { is_strict => 1 };
90
91 this allows enabling of versions is_strict checks to ensure that your
92 version is strict.
93
94 consistent
95
96 use Test::Version { consistent => 1 };
97
98 Check if every module has the same version number.
99
100 ignore_unindexable
101
102 use Test::Version { ignore_unindexable => 0};
103
104 if you have at least Module::Metadata v1.000020 Test::Version will by
105 default skip any files not considered is_indexable
106
107 filename_match
108
109 use Test::Version 2.0 { filename_match => [qr{Foo/Bar.pm$}] };
110
111 Only test files that match the given pattern. Pattern may be a list of
112 strings, regular expressions or code references. The filename will
113 match if it matches one or more patterns.
114
115 string
116
117 The file matches if it matches the pattern string exactly.
118
119 regular expression
120
121 The file matches if it matches the regular expression.
122
123 code reference
124
125 The file matches if the code reference returns a true value. The
126 filename is passed in as the only argument to the code reference.
127
128 multiple
129
130 use Test::Version 2.02 { multiple => 1 };
131
132 Test each version for each package if multiple packages are found in a
133 file.
134
135SEE ALSO
136
137 The goal is to have the functionality of all of these.
138
139 Test::HasVersion
140
141 Test::ConsistentVersion
142
143 Test::GreaterVersion
144
145 If you are using Dist::Zilla there is a plugin
146
147 Dist::Zilla::Plugin::Test::Version
148
149BUGS
150
151 Please report any bugs or feature requests on the bugtracker website
152 https://github.com/plicease/test-version/issues
153
154 When submitting a bug or request, please include a test-file or a patch
155 to an existing test-file that illustrates the bug or desired feature.
156
157CONTRIBUTORS
158
159 * Damyan Ivanov <dmn@debian.org>
160
161 * Dave Rolsky <autarch@urth.org>
162
163 * Gabor Szabo <gabor@szabgab.com>
164
165 * Karen Etheridge <ether@cpan.org>
166
167 * Michael G. Schwern <schwern@pobox.com>
168
169 * Mike Doherty <doherty@cs.dal.ca>
170
171 * particle <particle@cpan.org>
172
173AUTHORS
174
175 * Graham Ollis <plicease@cpan.org>
176
177 * Caleb Cushing <xenoterracide@gmail.com>
178
179COPYRIGHT AND LICENSE
180
181 This software is Copyright (c) 2018 by Caleb Cushing.
182
183 This is free software, licensed under:
184
185 The Artistic License 2.0 (GPL Compatible)
186
187