App::CELL::Test(3pm)
π App::CELL::Test β the vibe check on unit testing π
okay so bestie, this is App::CELL::Test, a Perl module living in the User Contributed Perl Documentation section of the manual (that's the (3pm) bit, iykyk). It's the lil backstage crew of the CELL project: a whole pile of special-purpose functions that only really show up when you're running CELL's test suite. She's not for production, she's for vibes and validation. β¨
πΈ 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' ]
);
like look at her go π«Ά she makes a tmpdir, touches some files, and compares arrays. no notes.
π¦ DESCRIPTION π¦
The "App::CELL::Test" module provides a number of special-purpose functions for use in CELL's test suite.
that's it. that's the whole job description. she's the test-suite bestie and she ate. π
π EXPORTS π
This module exports the following routines:
cleartmpdircmp_arraysmktmpdirpopulate_filetouch_files
π PACKAGE VARIABLES π
(no cap, this section is literally empty in the original. iconic of her to leave a blank space and just move on. we respect it.)
π₯ FUNCTIONS π₯
π« mktmpdir
Creates the App::CELL testing directory in a temporary directory β and that temp dir is obtained using File::Temp, just so you know where it came from β and returns the path to this directory in the payload of a status object. ποΈ
π« cleartmpdir
DESTROYs the temporary directory object (see File::Temp). it's giving cleanup era. she is done with that directory. πβ¨
π§ _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. π
bestie heads up: if that file already exists, it's getting unlinked first. no survivors, only fresh content. π
π« 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). βοΈ
and that's the whole page, bestie! ππ this gorgeous thing lives in the manual as App::CELL::Test(3pm), it's part of the User Contributed Perl Documentation collection, and she was written for perl v5.34.0 back on 2022-07-17. mwah, go write some tests. ππ¦π
π¦ where this page comes from
- debian bookworm: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- debian trixie: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- ubuntu noble: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- ubuntu resolute: libapp-cell-perl 0.231-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms