App::CELL::Test(3pm)

App::CELL::Test3pm

Functions for unit testing

Usage

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

Overview

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

Exports

This module exports the following routines:
cleartmpdir
cmp_arrays
mktmpdir
populate_file
touch_files

Package variables

Functions

mktmpdir

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.

cleartmpdir

DESTROYs the temporary directory object (see File::Temp).

_touch

Touch a file

touch_files

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

populate_file

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.

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

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9
  2. 10
  3. 11
  4. 12–13

From libapp-cell-perl 0.231-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.