TEST2::PLUGIN::BAILONFAIL(3perl)
β¨ NAME β¨
Test2::Plugin::BailOnFail β bestie, this is the module that's like "okay we're DONE here" the literal second a test fails π it auto-bails you out of testing on the first failure, no cap.
(also it lives in section 3perl of your manual, iykyk π)
π¦ DESCRIPTION π¦
Okay so here's the vibe: this module will issue a bailout event right after the first test failure. That's it. That's the whole thing. And the consequence? It prevents your tests from continuing β like, the rest of the suite just does not get to run. Periodt β
Now the β¨fancyβ¨ detail, and honestly this part is giving main character energy: the bailout runs when the context is released. Translation? It fires when the test function you're using β something like ok() β returns. Not before, not mid-call. On the way out. π«Ά
And why does the timing matter, bestie? Because it gives the tools the ability to output any extra diagnostics they may need. Like, they get their little moment to spill the tea before the whole thing goes down. Gorgeous behaviour honestly ππ
πΈ SYNOPSIS πΈ
use Test2::V1;
use Test2::Plugin::BailOnFail;
T2->ok(1, "pass");
T2->ok(0, "fail");
T2->ok(1, "Will not run");
See how that third one literally never gets to run?? it's a ghost π» the fail took everybody down with it. Slay? Honestly yes.
π SOURCE π
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/ β go look, it's right there, no gatekeeping here π₯
π MAINTAINERS π
- Chad Granum
<exodist@cpan.org>
β AUTHORS β
- Chad Granum
<exodist@cpan.org>
(yeah bestie same name twice, the manpage said it so we said it π)
π 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 that's the whole page, you ate it, iconic, go write some tests that don't fail on the first try π β¨
this manual page came to you from perl v5.44.0, dated 2026-10-17 β mwah, no notes π«Άπ
π¦ 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