---
name: "App::CELL::Test"
section: "3pm"
platform: "linux"
package: "libapp-cell-perl"
version: "0.231-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/App::CELL::Test"
---

# App::CELL::Test(3pm)

functions for unit testing

## NAME

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

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