TEST2::EVENT::PLAN(3pm)

πŸ’– NAME πŸ’–

Test2::Event::Plan β€” it's literally the event of a plan, bestie ✨

(also hi, welcome to the Test2::Event::Plan(3pm) page from the Perl Programmers Reference Guide, you're gonna slay this)


🌸 DESCRIPTION 🌸

okay so picture this: a plan event gets fired off every single time a plan is declared, whenever done testing is called, or when a subtext completes. that's it, that's the whole vibe πŸŽ€

like, it's giving "the receipts of test planning" ngl πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

use Test2::API qw/context/;
use Test2::Event::Plan;

my $ctx = context();

# Plan for 10 tests to run
my $event = $ctx->plan(10);

# Plan to skip all tests (will exit 0)
$ctx->plan(0, skip_all => "These tests need to be skipped");

look at her go 😭 ten whole tests, planned, iconic. and that skip_all one will exit 0 β€” noted, bestie, that's important 🫢


✨ ACCESSORS ✨

  • $num = $plan->max β€” get the number of expected tests πŸ”’ like, how many tests are we even doing here
  • $dir = $plan->directive β€” get the directive, such as TODO, skip_all, or no_plan πŸ“‹ the whole mood of the plan, basically
  • $reason = $plan->reason β€” get the reason for the directive πŸ’¬ the why, the lore, the backstory

🧚 SOURCE 🧚

the source code repository for Test2 lives right here, no cap:

<https://github.com/Test-More/test-more/>

go look, it's lowkey fascinating πŸ’œ


πŸ‘‘ 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 <https://dev.perl.org/licenses/>

fr fr read the license before you go redistributing, okay? it's the polite thing to do πŸ’–

and that's the whole page, bestie πŸŽ€ you ate. this was perl v5.42.3, dated 2026-11-03, signing off from Test2::Event::Plan(3pm) β€” mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from