NAME

Test::File::Contents - Test routines for examining the contents of files

Version

Version 0.02

Synopsis

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);

Functions

file_contents_is

Checks for an exact match on the file's contents.

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?

file_contents_like

Checks for a regexp match against the file's contents. You must provide it with a qr// style regexp.

file_md5sum

Checks whether a file matches a given md5sum. The md5sum should be provided as a hex string, eg. "6df23dc03f9b54cc38a0fc1483df6e21".

file_contents_identical

Tests that the contents of two files are identical.

Author

Kirrily Robert, <skud@cpan.org>

Bugs

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.

Copyright & License

Copyright 2004 Kirrily Robert, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.