TEST2::COMPARE::ORDEREDSUBSET(3perl)
π
Test2::Compare::OrderedSubset β from the Test2::...dSubset(3perl) page
okay bestie, pull up a chair, we're doing Perl internals today and honestly? it slaps.
β¨ NAME β¨
Test2::Compare::OrderedSubset β the internal representation of an ordered subset. yep. that's the whole job description. π
π¦ DESCRIPTION π¦
so here's the vibe. this module exists to check that an array has all the expected items in the expected order. that's it, that's the girl's whole personality. π
and the way it does that? it ignores any unexpected items that got mixed into the array. extra stuff shows up? not her problem, she doesn't even look. π
the only thing she cares about is that every expected value is present and in order. everything else? noise. literally just background static. she's the main character, the other array elements are just extras in her story. π
πΈ METHODS πΈ
$ref = $arr->inref()β if this instance got built from an actual, real, honest-to-god array, this hands you back the reference to that array. if it wasn't built from oneβ¦ well, no reference for you. π«Ά$arrayref = $arr->items()$arr->set_items($arrayref)β this is the whole list of expected items, in order. getter reads it, setter sets it. iconic duo behavior. β¨$name = $arr->name()β always, always, returns the string"<ORDERED SUBSET>". no mood swings, no surprises, just a name that never changes. π$bool = $arr->verify(got => $got, exists => $bool)β checks whether$gotis an array reference or not. yes or no, bestie, that's the whole question. β$arr->add_item($item)β drops one more item onto the pile of values that need checking. π@deltas = $arr->deltas(got => $got, convert => \&convert, seen => \%seen)β here's where the detective work happens: it finds the differences between the expected array values and the ones sitting inside the$gotarrayref. tell me why this is the most dramatic method here. π
π SOURCE π
the source code repository for Test2-Suite lives right here, go be nosy:
https://github.com/Test-More/test-more/
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
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/
okay that's the whole page, you ate that fr fr π this was pulled from the perl v5.44.0 docs dated 2026-10-17 and the header up top there said Test2:...dSubset(3perl) β and yes the manual name really is squished like that, don't ask, it's giving compression algorithm. mwah, go forth and order your subsets. π¦β¨
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms