The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

VERSION

Version 0.127

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.

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