Test::...Result(3pm)
π NAME π
bestieβ¦ it's Test::Unit::Result β the unit testing framework helper class that is literally the backbone of the whole thing. no cap.
β¨ SYNOPSIS β¨
okay so real talk: this class is not meant to be used directly. like, at all. hands off, babe π«Ά
π DESCRIPTION π
so what does this icon actually do? this class is what the framework uses to record the results of tests, and it will throw an instance of a subclass of Test::Unit::Exception whenever there's an error or a failure. it's giving dramatic exits, fr fr π
to make that happen, this class gets called with a test case as its argument. then it calls that test case's run method right back, and catches any exceptions that get thrown. chaotic two-way communication, but it works π
ngl, you could 100% argue that Test::Unit::Result is the heart of the PerlUnit framework β because like, TestCase classes vary, and you can use one of several Test::Unit::TestRunners, but we always gather the results in a Test::Unit::Result object. main character energy, periodt π
and here's the quintessential call tree of the communication needed to record the results of a given test:
$aTestCase->run() {
# creates result
$aTestResult->run($aTestCase) {
# catches exception and records it
$aTestCase->run_bare() {
# runs test method inside eval
$aTestCase->run_test() {
# calls method $aTestCase->name()
# and propagates exception
# method will call Assert::assert()
# to cause failure if test fails on
# test assertion
# it finds this because $aTestCase is-a Assert
}
}
}
}
also bestie, heads up: when Test::Unit::TestSuites are in the mix, this call tree can get a little more convoluted π β but as long as you keep the above in mind, it should be apparent what's going on. iykyk β¨
πΈ AUTHOR πΈ
Copyright (c) 2000-2002, 2005 the PerlUnit Development Team (see Test::Unit or the AUTHORS file included in this distribution).
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π¦ SEE ALSO π¦
Test::Unit::AssertTest::Unit::TestCaseTest::Unit::Exception
and that's the whole vibe, babe π this page ships as part of perl v5.40.1, dated 2026-04-05 β documented under the Perl man pages, icon behavior only, slay πβ¨π
π¦ where this page comes from
- ubuntu stonking: libtest-unit-perl 0.30-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms