Test::S...::Object(3)
π Test::S...::Object(3) β the whole vibe
okay so bestie, this is Test::Stream::Compare::Object, a User Contributed Perl Documentation page, and it's literally the class that lets you describe an expected object inside a deep comparison. you get to poke at its fields and elements, call methods on it to check stuff, and even do meta checks on the object type and the ref type. it's giving β¨control freakβ¨ but in a good way.
π DEPRECATED
ngl this whole distribution is deprecated, bestie. it's been swapped out for Test2, Test2::Suite, and Test2::Workflow.
there's a conversion guide waiting for you at Test::Stream::Manual::ToTest2 if you need to make the move π«Ά
πΈ DESCRIPTION
This class lets you specify an expected object in a deep comparison. You can check the fields/elements of the underlying reference, call methods to verify results, and do meta checks for object type and ref type. that's the whole thing, and it's iconic π
β¨ METHODS β¨
$class = $obj->meta_classβ the meta-class to be used when checking the object type. It's mainly listed here because it's super useful to override for specialized object subclasses. Normally it just returnsTest::Stream::Compare::Meta. π$class = $obj->object_baseβ the base-class to be expected when checking the object type. Again, mostly listed because overriding it for specialized object subclasses is the move. Normally it just returns'UNIVERSAL'. π$obj->add_prop(...)β add a meta-property to check, seeTest::Stream::Compare::Meta. This method just delegates. no cap.$obj->add_field(...)β add a hash-field to check, seeTest::Stream::Compare::Hash. This method just delegates. π$obj->add_item(...)β add an array item to check, seeTest::Stream::Compare::Array. This method just delegates. π$obj->add_call($method, $check)$obj->add_call($method, $check, $name)β add a method call check. This will call the specified method on your object and verify the result.$methodmay be a method name, or a coderef. In the case of a coderef it can be helpful to provide an alternate name. When no name is provided the name is either$methodor the string'\&CODE'. π
π₯ SOURCE
The source code repository for Test::Stream can be found at http://github.com/Test-More/Test-Stream/. go star it, bestie.
π 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 tea β this was Test::S...::Object(3) from perl v5.42.0, dated 2025-07-25 β tysm for reading, ily, periodt π
β¨π«Ά
π¦ 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