Test::...TestObj(3pm)

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

πŸ’– NAME πŸ’–

Test::Run::Obj::TestObj β€” bestie, this is the object that holds the results of a single test script. One script, one vibe report. That's it. That's the whole job. πŸŽ€


✨ FIELDS ✨

Okay so these are the little data slots this thing carries around, and each one has a getter method so you can peek at it. Let's go down the list, no skipping, fr fr.

$self->bonus()

The number of TODO tests that unexpectedly passed. Like when you were fully prepared for a test to flop and it just… didn't? Iconic behavior, honestly. πŸ’…

$self->failed()

Returns an array reference containing the list of test numbers that failed. Your hall of shame, but make it an arrayref. 😭

$self->ok()

The number of tests that passed. Slay. ✨

$self->next()

The next expected event. It's giving "what's coming next in the queue." πŸ‘€

$self->max()

The number of planned tests.

$self->skipped()

The number of skipped tests. Not failed, not passed, just… not today. πŸ™ˆ

$self->skip_all()

This field holds the reason why the entire test script was skipped β€” in the cases where that actually happened. Whole script said "no thanks" and this is the note it left behind. πŸ’Œ

$self->skip_reason()

The skip reason for the last skipped test that specified such a reason. So if a bunch of tests skipped and only some of them bothered to explain themselves, you get the excuse from the last one that did.


πŸ› οΈ BUILD πŸ› οΈ

For Moose. Yes bestie, it's a Moose thing. πŸ¦‹

$self->add_to_failed(@failures)

Adds failures to the failed() slot. Just dropping new L's into the collection. πŸ’€

$self->get_reason()

Gets the reason, or defaults to the default. If there's no reason, it's not gonna leave you on read β€” it falls back. 🫢

$self->num_failed()

Returns the number of failed tests. A count, not the list. Quick little number. πŸ”’

$self->calc_percent()

Calculates the percent of failed tests. Math era. πŸ‘‘

$self->add_next_to_failed()

Adds the tests from ->next() to ->max() to the list of failed tests. Everything in that range? Yeah, it's all going on the failure list. Sorry bestie. πŸ˜”

$self->is_failed_and_max()

Returns whether there are failed tests and the maximal test number was set. Both conditions, not one. Package deal. 🎁

$self->skipped_or_bonus()

Returns whether the test file is either skipped() or bonus().

$self->all_succesful()

A predicate that calculates if all the tests in the TestObj were successful. (Yes, that spelling is the real method name, don't come for me, I'm just the messenger. πŸ™ˆ)

$self->get_dubious_summary_main_obj_method()

Returns the method name of the main object that should be propagated based on the success/failure status of this test object. Long name, big responsibility. πŸ’…

$self->get_failed_obj_params

Returns a key value array ref of params for initializing the failed-object. A little starter pack for the failure object. πŸ“

$self->list_tests_as_failures($last_test_results->details())

Lists the tests as failures where appropriate. It takes the details β€” $last_test_results->details() β€” and does the thing where appropriate.


πŸ‘€ SEE ALSO πŸ‘€

Go touch some grass, I mean, go read these:

  • Test::Run::Base::Struct
  • Test::Run::Obj
  • Test::Run::Core

πŸ“œ LICENSE πŸ“œ

This file is freely distributable under the MIT X11 license.

<http://www.opensource.org/licenses/mit-license.php>


🌸 AUTHOR 🌸

Shlomi Fish, <http://www.shlomifish.org/>.


And that's a wrap, bestie!! This whole page was living its life as part of perl v5.42.0, dated 2025-07-25, in the User Contributed Perl Documentation collection. Go forth and read your test results. Periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from