Test::Version - check for VERSION information in modules
version 0.03
use Test::Version; my $file = 'path/to/file.pm'; version_ok( $file );
Check files for VERSION information in perl modules. Inspired by brian d foy's Test::Pod (see Test::Pod).
IMPORTANT: This is alpha software, that was originally released in 2002. This is the last release of this module based on this code, the next release of Test::Version will be a rewrite from the ground up and will contain API changes. This version was released to notify of new maintainership and coming changes without breaking API. No functional code changes were made to this module in this relaease.
Deprecation Note: EXPECTED is going away and the returns are are changing. simply calling version_ok( $filename ); should still work, however it will be stricter in future versions by checking for version validity.
version_ok( $filename );
version_ok requires a filename and returns one of the three values:
NO_FILE Could not find the file NO_VERSION File had no VERSION information VERSION_OK VERSION information exists
version_ok okays a test without an expected result if it finds VERSION information, or if an expected result is specified and it finds that condition. For instance, if you know there is no VERSION information,
version_ok( $file, NO_VERSION );
When it fails, version_ok will show error information.
The optional third argument NAME is the name of the test which version_ok passes through to Test::Builder. Otherwise, it choose a default test name "VERSION test for FILENAME".
Currently only checks files ending in '.pm', and expects the package name to match the filename. I'm open to suggestions for more robust parsing.
Thanks to brian d foy for the inspiration -- his Test::Pod module (on which this code is based,) and his "Better Documentation Through Testing" article in The Perl Journal, Nov 2002 (see http://www.tpj.com/).
particle <particle@cpan.org>
Caleb Cushing <xenoterracide@gmail.com>
This software is Copyright (c) 2002 by Ars ex Machina, Corp..
This is free software, licensed under:
The Artistic License 1.0
To install Test::Version, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Version
CPAN shell
perl -MCPAN -e shell install Test::Version
For more information on module installation, please visit the detailed CPAN module installation guide.