Test2:...Target(3perl)
π NAME π
Test2::Tools::Target β bestie, this one just aliases your testing target package. That's it, that's the whole job. β¨
πΈ DESCRIPTION πΈ
Okay so picture this: you're testing some package, and typing its whole long name over and over is giving exhausting. This module lets you alias the package you're testing into a constant and a package variable, so your test file can just vibe with a short little name instead. π¦
β¨ SYNOPSIS β¨
Like, super simple:
use Test2::Tools::Target 'Some::Package';
CLASS()->xxx; # Call 'xxx' on Some::Package
$CLASS->xxx; # Same
Or you can specify names, if you want to be extra about it:
use Test2::Tools::Target pkg => 'Some::Package';
pkg()->xxx; # Call 'xxx' on Some::Package
$pkg->xxx; # Same
See how CLASS() and $CLASS both hit Some::Package? Yeah. Same energy, two ways to call it. π
π SOURCE π
Wanna peek at the source code repository for Test2-Suite? Iconic behavior, honestly. It lives at:
https://github.com/Test-More/test-more/
π MAINTAINERS π
Chad Granum <exodist@cpan.org> β carrying this whole thing on his back, fr fr. π«Ά
π AUTHORS π
Chad Granum <exodist@cpan.org>
(yes bestie, same person, he's just that guy π)
π 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/
okay and that's the whole page, no cap π« β this was Test2:...Target(3perl) from the Perl Programmers Reference Guide, running on perl v5.44.0, dated 2026-10-17. Slay, go write some tests, mwah ππ§
π¦ 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