NAME

App::CELL::Test - functions for unit testing

VERSION

Version 0.143

SYNOPSIS

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

DESCRIPTION

The App::CELL::Test module provides a number of special-purpose functions for use in CELL's test suite.

EXPORTS

This module provides the following exports:

cmp_arrays - cmp_arrays routine

PACKAGE VARIABLES

FUNCTIONS

mktmpdir

Creates the App::CELL testing directory in the system temporary directory (e.g. /tmp) and returns the path to this directory or "undef" on failure.

cleartmpdir

Wipes (rm -rf) the App::CELL testing directory, if it exists. Returns:

true App::CELL testing directory successfully wiped or not there in the first place
false directory still there even after rm -rf attempt

touch_files

"Touch" some files. Takes: directory path and list of files to "touch" in that directory. Returns number of files successfully touched.

cmp_arrays

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