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 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