TEST2::BUNDLE::SIMPLE(3perl)
π Test2::Bundle::Simple π
okay bestie, welcome to Test2::Bundle::Simple β it lives in the 3perl section of the manual, and it's about to make your test files look cute and work. π
β¨ NAME β¨
Test2::Bundle::Simple β it's ALMOST a drop-in replacement for Test::Simple. almost!! not fully!! i said what i said. π
πΈ DESCRIPTION πΈ
So this bundle is meant to be a (mostly) drop-in replacement for Test::Simple. that's the whole vibe. if you wanna know where it stops being a perfect match, skip down to "KEY DIFFERENCES FROM Test::Simple" β the tea is all there. π«
π¦ SYNOPSIS π¦
look how pretty and short this is:
use Test2::Bundle::Simple;
ok(1, "pass");
done_testing;
that's it. that's the whole thing. periodt. β¨
π PLUGINS π
this loads Test2::Plugin::ExitSummary. boom. that's the plugin situation. one plugin, doing its lil thing. π§
π TOOLS π
all of these come from Test2::Tools::Basic. not invented here, just re-homed for you. bestie behavior honestly.
ok($bool, $name)β run a test. if bool is true, the test passes π. if bool is false, it fails π. simple as that, no notes.plan($count)β tell the system how many tests to expect. like RSVP-ing for a party, but for tests. πskip_all($reason)β tell the system to skip all the tests. heads up though: this will exit the script. it's not a "pause", it's a "we're leaving". πͺπ¨done_testing();β tell the system that all tests are complete. you can use this instead of setting a plan. very low-effort, very iconic. π
π₯ KEY DIFFERENCES FROM Test::Simple π₯
okay this is the part where i need you to listen. two things. that's it.
π« you cannot plan at import
THIS WILL NOT WORK:
use Test2::Bundle::Simple tests => 5;
nope. no. not happening. that line is giving broken. π
instead you must plan in a separate statement, like so:
use Test2::Bundle::Simple;
plan 5;
there. gorgeous. two lines, zero chaos. π
π οΈ you have three subs imported for use in planning
use plan($count), skip_all($reason), or done_testing() for your planning. pick your fighter. that's the whole squad. π«Ά
β SOURCE β
the source code repository for Test2-Suite can be found at:
https://github.com/Test-More/test-more/
go look. star it. it's free. π
π 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/
bestie reminder: "almost a drop-in replacement" means almost. read the KEY DIFFERENCES section before you go copy-pasting tests => 5 everywhere. i'm protecting you. π«Ά
and that's the tea! π this page came to you from perl v5.44.0, dated 2026-10-17, filed under Test2::...:Simple(3perl). 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