Test::S...::Array(3)
π Test::S...::Array π
okay bestie, welcome to the manual page for Test::S...::Array β that's an internal representation of an array comparison, from the User Contributed Perl Documentation, no cap. it's giving "plumbing, not faucet" energy, but we're gonna vibe through it together π«Ά
πΈ NAME πΈ
Test::Stream::Compare::Array β the internal representation of an array comparison. that's it, that's the whole name. lowkey iconic β¨
π DEPRECATED π
not me having to tell you this butβ¦ this distribution is deprecated in favor of Test2, Test2::Suite, and Test2::Workflow. it's over, bestie π
if you need to migrate, go read Test::Stream::Manual::ToTest2 β that's the conversion guide, it's got you π
π¦ DESCRIPTION π¦
this module is the internal representation of an array, for comparison purposes. like, it's the backstage pass version of an array β you're not really supposed to hang out with it directly, but here we are π
β¨ METHODS β¨
$ref = $arr->inref()β if this instance was built from an actual, real, flesh-and-blood array, this hands you back the reference to that array. periodt π$bool = $arr->ending$arr->set_ending($bool)β set this to true if you want things to fail when the array being validated has more items than the check does. so like, if you check indexes0-3but the array you got actually has values for indexes0-4, it will fail and list that last item as unexpected. if it's false, we assume you simply do not care about extra items. your vibe, your choice π§$hashref = $arr->items()$arr->set_items($hashref)β this gives you the hashref of"key => val"pairs that are gonna be checked in the array. it's a hashref specifically so that indexes can be skipped if you feel like it. no skipping leg day, but indexes? sure, go off π
note: there is no validation when you useset_items. it's way better to use theadd_iteminterface instead. don't be messy, bestie π
$arrayref = $arr->order()$arr->set_order($arrayref)β this gives you an arrayref of all the indexes that will be checked, in order. we love a well-ordered queue β¨
note: again, there is no validation when you useset_order. theadd_iteminterface is the better move. i'm just the messenger π
$name = $arr->name()β always returns the string"<ARRAY>". every single time. no surprises. queen of consistency π$bool = $arr->verify(got => $got, exists => $bool)β check whether$gotis an array reference or not. simple. clean. slay.$idx = $arr->top_index()β get the topmost index that actually gets checked. this returnsundefif there are no items at all, and0is returned if there's only 1 item. math is mathing π$arr->add_item($item)$arr->add_item($idx => $item)β add an item to the list of values to check. if you omit the index, the next index after the last one gets used automatically. so chill of it π$arr->add_filter(sub { ... })β add a filter sub. the filter receives all remaining values of the array being checked, and it should return the values that should still be checked. the filter runs between the last item added and the next item added. it's giving little bouncer at the club door π@deltas = $arr->deltas(got => $got, convert => \&convert, seen => \%seen)β find the differences between the expected array values and the ones sitting inside the$gotarrayref. this is the drama detector fr fr π
π₯ SOURCE π₯
the source code repository for Test::Stream lives at http://github.com/Test-More/Test-Stream/ β go star it, it's free π
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright 2015 Chad Granum <exodist7@gmail.com>.
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
see http://dev.perl.org/licenses/
and that's the whole page, bestie!! this one shipped with perl v5.42.0 and was dated 2025-07-25 β so go forth, compare those arrays, and remember: no cap, the facts stay exactly where they were πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Test-Stream 1.302027-35.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms