Test::File::Contents - Test routines for examining the contents of files
Version 0.05
use Test::File::Contents; file_contents_is ($file, $string, $test_description); file_contents_like ($file, qr/foo/, $test_description); file_md5sum ($file, $md5sum, $test_description); file_contents_identical($file1, $file2, $test_description);
Checks for an exact match on the file's contents. Pass in a Unix-style file name and it will be converted for the local file system.
Note: performs a dumb "eq" comparison, sucking the whole file into memory.
Also note: I am aware of the grammatical confusion in the function name - got a better suggestion?
Checks that the file's contents do not match a string. Pass in a Unix-style file name and it will be converted for the local file system.
Note: performs a dumb "ne" comparison, sucking the whole file into memory.
Checks for a regexp match against the file's contents. You must provide it with a qr// style regexp. Pass in a Unix-style file name and it will be converted for the local file system.
Checks for a regexp failed match against the file's contents. You must provide it with a qr// style regexp. Pass in a Unix-style file name and it will be converted for the local file system.
Checks whether a file matches a given md5sum. The md5sum should be provided as a hex string, eg. "6df23dc03f9b54cc38a0fc1483df6e21". Pass in a Unix-style file name and it will be converted for the local file system.
Tests that the contents of two files are identical. Pass in a Unix-style file name and it will be converted for the local file system.
Kirrily Robert, <skud@cpan.org>
<skud@cpan.org>
Contributors:
David Wheeler, <dwheeler@cpan.org>
<dwheeler@cpan.org>
Please report any bugs or feature requests to bug-test-file-contents@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-test-file-contents@rt.cpan.org
Copyright 2004-2005 Kirrily Robert.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Test::File::Contents, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::File::Contents
CPAN shell
perl -MCPAN -e shell install Test::File::Contents
For more information on module installation, please visit the detailed CPAN module installation guide.