TEST2::COMPARE::ORDEREDSUBSET(3pm)

πŸ’– NAME πŸ’–

Test2::Compare::OrderedSubset β€” the internal representation of an ordered subset. This little icon comes from the Perl Programmers Reference Guide, and the manual page is Test2::Compare::OrderedSubset(3pm). She’s not doing too much β€” she just knows exactly what she expects. πŸ’…

✨ DESCRIPTION ✨

Okay so bestie, this module’s whole thing is making sure an array has all the expected items in the expected order. It ignores any unexpected items mixed into the array β€” not her business, not her problem πŸ™ˆ. It only cares that all the expected values are present, and in order. Everything else is just noise. Periodt. πŸŽ€

πŸ’… METHODS πŸ’…

  • $ref = $arr->inref() β€” if the instance was constructed from an actual array, this has the reference to that array. Like the original array’s backstage pass. 🎟️
  • $arrayref = $arr->items() and $arr->set_items($arrayref) β€” all the expected items, in order. items() gives you the arrayref; set_items() sets it. Very β€œhere’s the lineup, don’t mess it up” energy. ✨
  • $name = $arr->name() β€” always returns the string "<ORDERED SUBSET>". No cap, that’s the name every single time. 🏷️
  • $bool = $arr->verify(got => $got, exists => $bool) β€” checks whether $got is an array reference or not. That’s the vibe check right there. 🫢
  • $arr->add_item($item) β€” adds an item to the list of values to check. One more expected value for the roster, slay. πŸ“‹
  • @deltas = $arr->deltas(got => $got, convert => \&convert, seen => \%seen) β€” finds the differences between the expected array values and the ones in the $got arrayref. Detective mode: on. πŸ”

🌈 SOURCE 🌈

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. Go browse, bestie, it’s iconic. πŸ‘‘

πŸ¦‹ MAINTAINERS πŸ¦‹

Chad Granum <exodist@cpan.org>

🌸 AUTHORS 🌸

Chad Granum <exodist@cpan.org>

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/


Mwah πŸ’‹ β€” footer vibes: perl v5.42.3, dated 2026-11-03. Stay gorgeous and keep those expected values in order, bestie πŸ«ΆπŸ’–

πŸ“¦ where this page comes from