Test2::...:Target(3pm)

πŸ’– NAME πŸ’–

okay bestie, this is the Test2::Tools::Target page from the Perl Programmers Reference Guide β€” the header line is all Test2::...:Target(3pm), but the NAME section has the full tea: Test2::Tools::Target β€” Alias the testing target package. ✨

🌸 DESCRIPTION 🌸

This lets you alias the package you are testing into a constant and a package variable. No cap. It’s literally giving your target package a little nickname so your tests can call it without all the extra typing. Iconic. πŸ’…

✨ SYNOPSIS ✨

okay so here’s the vibe:

use Test2::Tools::Target 'Some::Package';

CLASS()->xxx; # Call 'xxx' on Some::Package
$CLASS->xxx;  # Same

Or bestie, you can specify names:

use Test2::Tools::Target pkg => 'Some::Package';

pkg()->xxx; # Call 'xxx' on Some::Package
$pkg->xxx;  # Same

πŸ”₯ SOURCE πŸ”₯

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

πŸ‘‘ 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/


that’s the whole page, bestie! footer check: perl v5.42.3, dated 2026-11-03 β€” mwah, go slay your tests πŸ’…βœ¨

πŸ“¦ where this page comes from