Test2::Handle(3perl)

πŸ“¦ version 5.44.0, in arch rolling

πŸ’– NAME πŸ’–

Test2::Handle β€” the base class for Test2 handles, bestie, the ones you use inside V# bundles ✨


🌸 DESCRIPTION 🌸

Okay so picture this: you're writing a test, you use the T2() function in something that runs on Test2::V1, and the thing you get back and poke at? that's this. That's the whole vibe. It's the handle, it's the main character, and this page is its origin story 🫢


✨ SYNOPSIS ✨

use Test2::V1;

my $handle = T2();

$handle->ok(1, "Passing Test");

πŸ¦‹ WITHOUT SUGAR (raw-dogging it, we respect it)

use Test2::Handle();

my $handle = Test2::Handle->new(base => 'Test2::V1::Base');

$handle->ok(1, "Passing test");

πŸ’… METHODS πŸ’…

Okay so here's the tea: most methods get delegated to the base class you handed over at construction time. But there's a lil handful of methods that this package defines all on its own, and those are the ones we're gonna go through. Sit down, get comfy πŸ“

  • $base = $class_or_inst->DEFAULT_HANDLE_BASE β€” hands you back the default handle base. And here's the thing: on the base handle class itself, this one throws an exception. So like, you're supposed to override it in a subclass, bestie. Don't try to use the original one, it will not work, it's giving "no" πŸ’€
  • $base = $inst->HANDLE_BASE β€” in this base class, this method always throws an exception. Always? Always. Every single time. But in a subclass, it should return the default base class you wanna use for that subclass. That's the job. That's its whole purpose ✨
  • $namespace = $inst->HANDLE_NAMESPACE β€” grabs the namespace that we use to store all the functions we wrap up as methods πŸ”₯
  • @sub_names = $inst->HANDLE_SUBS β€” gives you a list of every sub that's available in the handle namespace. All of them. The whole roster πŸ‘‘
  • $inst->HANDLE_INCLUDE($package, @subs) β€” pulls the specified subs out of the specified package and imports them right into our internal namespace. Very "you belong to me now" energy πŸ’œ
  • $inst = $class->import() β€” this is the one that makes a T2() sub appear in your namespace at import time. Sprinkles it right in there like glitter 🌈
  • $inst->init() β€” internal business, bestie. It initializes and validates the handle object. That's it, that's the job 🧚

⭐ AUTOLOAD ⭐

Internally used to wrap functions as methods. That's the whole thing. Iconic behaviour, truly πŸ™ˆ


πŸ”₯ SOURCE πŸ”₯

The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. Go be nosy, you're allowed 🫢


πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org>


🌟 AUTHORS 🌟

Chad Granum <exodist@cpan.org>


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/


okay that's the whole page bestie, you ate that, periodt πŸ’…βœ¨ This was Test2::Handle(3perl), hanging out in perl v5.44.0, dated 2026-10-17 β€” love u, go write some passing tests πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from
  • arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND 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