Test::...TestObj(3pm)
π 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::StructTest::Run::ObjTest::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
- fedora 43: perl-Test-Run 0.0306-3.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND GPL-2.0-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms