Test::S...::Object(3)

πŸ“¦
version 1.302027 Β· 2 versions
, in fedora 43

πŸ’– 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 returns Test::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, see Test::Stream::Compare::Meta. This method just delegates. no cap.
  • $obj->add_field(...) β€” add a hash-field to check, see Test::Stream::Compare::Hash. This method just delegates. πŸ’œ
  • $obj->add_item(...) β€” add an array item to check, see Test::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. $method may 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 $method or 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 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