App::CELL::Test - functions for unit testing
Version 0.165
use App::CELL::Test; App::CELL::Test::cleartmpdir(); my $tmpdir = App::CELL::Test::mktmpdir(); App::CELL::Test::touch_files( $tmpdir, 'foo', 'bar', 'baz' ); my $booltrue = App::CELL::Test::cmp_arrays( [ 0, 1, 2 ], [ 0, 1, 2 ] ); my $boolfalse = App::CELL::Test::cmp_arrays( [ 0, 1, 2 ], [ 'foo', 'bar', 'baz' ] );
The App::CELL::Test module provides a number of special-purpose functions for use in CELL's test suite.
App::CELL::Test
This module exports the following routines: cleartmpdir cmp_arrays mktmpdir populate_file touch_files
Creates the App::CELL testing directory in a temporary directory (obtained using File::Temp) and returns the path to this directory in the payload of a status object.
DESTROYs the temporary directory object (see File::Temp).
"Touch" some files. Takes: directory path and list of files to "touch" in that directory. Returns number of files successfully touched.
Takes filename (full path) and contents (as a string, potentially containing newlines) to write to it. If the file exists, it is first unlinked. Then the routine creates the file and populates it with the contents. Returns true if something was written, or false if not.
Compare two arrays of unique elements, order doesn't matter. Takes: two array references Returns: true (they have the same elements) or false (they differ).
To install App::CELL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::CELL
CPAN shell
perl -MCPAN -e shell install App::CELL
For more information on module installation, please visit the detailed CPAN module installation guide.