Test2::Handle(3pm)
β¨ NAME β¨
Test2::Handle β the base class for Test2 handles, the ones you use inside V# bundles. π
πΈ DESCRIPTION πΈ
okay so bestie, this is literally the thing you're vibing with when you call the T2() function in a test that uses Test2::V1. That's it. That's the whole deal. It's the handle. It's giving main character energy. π«Ά
π SYNOPSIS π
β¨ RECOMMENDED β¨
the way we highly recommend doing it, no cap:
use Test2::V1;
my $handle = T2();
$handle->ok(1, "Passing Test");
π¦ WITHOUT SUGAR π¦
if you wanna raw-dog it with no syntactic sugar (iconic of you honestly):
use Test2::Handle();
my $handle = Test2::Handle->new(base => 'Test2::V1::Base');
$handle->ok(1, "Passing test");
π METHODS π
lowkey most of these methods get delegated to the base class you handed over at construction. But there are a few that this package defines all on its own, like the little overachievers they are. π
$base = $class_or_inst->DEFAULT_HANDLE_BASEβ grab the default handle base. Heads up bestie: this one throws an exception on the base handle class itself, so you're supposed to override it in a subclass. Periodt.$base = $inst->HANDLE_BASEβ in this base class, this method always throws an exception, every single time, no exceptions (well, except the exception). In a subclass? It should return the default base class that subclass should be using. π«$namespace = $inst->HANDLE_NAMESPACEβ gets you the namespace where we stash the functions we wrap up as methods. ποΈ@sub_names = $inst->HANDLE_SUBSβ gimme the full list of every sub available in the handle namespace please and thank you. π$inst->HANDLE_INCLUDE($package, @subs)β imports the specified subs from the specified package straight into our internal namespace. Come on in, the water's fine. π$inst = $class->import()β used to create aT2()sub in your namespace at import time. Very demure, very mindful. β¨$inst->init()β internal business only: initializes and validates the handle object. Don't touch this one, it's doing its job. π
π AUTOLOAD π
internally used to wrap functions as methods. that's it. that's the whole vibe. π₯
π SOURCE π
the source code repository for Test2-Suite lives right here, bestie:
https://github.com/Test-More/test-more/
π«Ά MAINTAINERS π«Ά
Chad Granum <exodist@cpan.org>
π AUTHORS π
Chad Granum <exodist@cpan.org>
π COPYRIGHT π
Copyright Chad Granum <exodist@cpan.org>.
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/
ok that's the whole page, you ate that fr fr π β¨
and that's a wrap on this lil gem of a page β brought to you by perl v5.40.1, dated 2026-06-21, and lovingly filed under User Contributed Perl Documentation as Test2::Handle(3pm). mwah. πππ¦
π¦ where this page comes from
- ubuntu stonking: libtest-simple-perl 1.302222-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