Test2::Plugin(3perl)
β¨ NAME β¨
Test2::Plugin β it's literally the documentation for plugins, bestie π
π DESCRIPTION π
okay so listen. Plugins are packages that cause behavior changes, or other side-effects, for the test file that loads them. that's their whole thing. that's the gig π
they should not export any functions. they should not provide any tools. periodt. plugins are supposed to be distinct units of functionality, no crossover episodes π ββοΈ
so if you wanna combine behavior changes with tools? iconic, but you don't cram it all into one thing. write a Plugin, write a Tools module, and write a bundle that loads them both. slay in three parts π«Ά
πΈ FAQ πΈ
should I subclass Test2::Plugin? π
No. ngl bestie, currently this class is empty. like, nothing in it. but eventually they may want to add behavior, and if that happens they do not want anyone to already be subclassing it. so... don't. it's giving "please don't" π
π¦ HOW DO I WRITE A PLUGIN? π¦
okay real talk: writing a plugin is not as simple as writing a Test2::Bundle, or writing Test2::Tools. plugins alter behavior, or cause desirable side-effects β that's the whole vibe check. and to pull that off you typically need a custom import() method that calls one or more functions provided by the Test2::API package β¨
so if you wanna write a plugin, go look at existing plugins, and also go read the Test2::API and Test2::Hub documentation. there is no formula for a Plugin β they are generally unique, main character energy only π
but there are consistent rules, and they're non-negotiable:
- they should not load other plugins
- they should not export any functions
that's it, that's the rules, iykyk π
π SOURCE π
the source code repository for Test2-Suite can be found at 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/ π§
and that's a wrap, bestie!! this lil masterpiece came from perl v5.44.0, dated 2026-10-17, and it's the one and only Test2::Plugin(3perl) β go forth and write plugins that behave responsibly π
πβ¨
π¦ 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