Test::...::Array(3pm)
๐ NAME ๐
Test::Data::Array โ test functions for array variables. That's it, that's the whole vibe: a lil grab-bag of Test:: functions that let you vibe-check your arrays. This page lives in the User Contributed Perl Documentation section as Test::...::Array(3pm), iykyk. ๐
โจ SYNOPSIS โจ
use Test::Data qw(Array);
That's the whole summoning ritual bestie. Pull in Array from Test::Data and you're off. ๐
๐ฆ DESCRIPTION ๐ฆ
๐ธ Functions ๐ธ
okay so here's the lineup. Every single one of these is a Test:: style check โ it tells you whether the thing you're describing is true about your array. Most of them take an optional NAME at the end, which is just the label for the test, and if you don't pass one, whatever, it does its own thing. ๐ซถ
array_any_ok( ITEM, ARRAY [, NAME] )โ ok if any element of ARRAY is ITEM. one (1) match and we're thriving โจarray_none_ok( ITEM, ARRAY [, NAME] )โ ok if no element of ARRAY is ITEM. not a single one, and honestly? iconic ๐array_once_ok( ITEM, ARRAY [, NAME] )โ ok if only one element of ARRAY is ITEM. exactly one. not two. main character energy only ๐array_multiple_ok( ITEM, ARRAY [, NAME] )โ ok if more than one element of ARRAY is ITEM. the more the merrier fr fr ๐ฅarray_max_ok( NUMBER, ARRAY [, NAME] )โ ok if all elements of ARRAY are numerically less than or equal to NUMBER. nobody's out here exceeding the ceiling, we stay humble ๐ธarray_min_ok( NUMBER, ARRAY [, NAME] )โ ok if all elements of ARRAY are numerically greater than or equal to NUMBER. everyone clears the bar, no flops allowed โจarray_maxstr_ok( ITEM, ARRAY [, NAME] )โ ok if all elements of ARRAY are asciibetically less than or equal to MAX. yes bestie, asciibetically, we're comparing them as strings ๐array_minstr_ok( ITEM, ARRAY [, NAME] )โ ok if all elements of ARRAY are asciibetically greater than or equal to MAX. string-wise, nobody's under the floor ๐array_sum_ok( SUM, ARRAY [, NAME] )โ ok if the numerical sum of ARRAY is SUM. math girlies rise ๐งฎarray_empty_ok( ARRAY [, NAME] )โ ok if the array contains no elements. void vibes. nothing in there and that's the point ๐ณ๏ธarray_length_ok( ARRAY, LENGTH [, NAME] )โ ok if the array contains LENGTH number of elements. yes, the exact count, we're counting ๐ขarray_sortedstr_ascending_ok( ARRAY, [, NAME] )โ ok if each succeeding element is asciibetically greater than or equal to the one before. string-wise ascending, going up and up ๐ฆarray_sortedstr_descending_ok( ARRAY, [, NAME] )โ ok if each succeeding element is asciibetically less than or equal to the one before. string-wise descending, sliding down ๐array_sorted_ascending_ok( ARRAY, [, NAME] )โ ok if each succeeding element is numerically greater than or equal to the one before. numbers ascending, on the way up ๐array_sorted_descending_ok( ARRAY, [, NAME] )โ ok if each succeeding element is numerically less than or equal to the one before. numbers descending, on the way down โญ
bestie note: those sorted ones are written as ARRAY, [, NAME] in the original docs, comma and all. not me fixing it. it's giving iconic typo and we respect it ๐
๐ SEE ALSO ๐
the whole friend group, go say hi:
Test::DataTest::Data::ScalarTest::Data::FunctionTest::Data::HashTest::Builder
๐ SOURCE AVAILABILITY ๐
this source is in Github:
https://github.com/briandfoy/test-data
go star it, it's free and it's cute ๐
๐ AUTHOR ๐
brian d foy, "<briandfoy@pobox.com>" โ the legend himself fr fr ๐
๐ COPYRIGHT AND LICENSE ๐
Copyright ยฉ 2002-2025, brian d foy <briandfoy@pobox.com>. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.
and that's the whole page bestie ๐ซถ this lil masterpiece is running on perl v5.40.1, dated 2025-04-17, and it's filed under Test::...::Array(3pm) in the User Contributed Perl Documentation โ slay, no cap ๐
โจ
๐ฆ where this page comes from
- debian trixie: libtest-data-perl 1.248-1 ยท Artistic-2.0
- ubuntu resolute: libtest-data-perl 1.248-1 ยท Artistic-2.0
- ubuntu stonking: libtest-data-perl 1.248-1 ยท Artistic-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms