Test2::Event::Plan(3)

πŸ“¦ version 1.302214, in opensuse-leap 16.0

🌸 NAME 🌸

Test2::Event::Plan β€” the event of a plan. This page is from the User Contributed Perl Documentation, and we're folding that manual-name moment in right here at the top instead of making you read a crusty header. You're welcome, bestie. πŸ’–

✨ DESCRIPTION ✨

Plan events fire off whenever a plan is declared, whenever done testing is called, or whenever a subtext completes. Those are the three little moments where this event shows up and says hi. Periodt. πŸ‘‹βœ¨

πŸŽ€ SYNOPSIS πŸŽ€

Okay, here's the exact recipe β€” copy it character for character if you need it:

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");

πŸ’… ACCESSORS πŸ’…

The accessors are giving main character energy β€” here's the whole lineup:

  • $num = $plan->max β€” gets the number of expected tests. Literally the test count, bestie. πŸ”’
  • $dir = $plan->directive β€” gets the directive, such as TODO, skip_all, or no_plan. That's the instruction vibe, ngl. πŸ“
  • $reason = $plan->reason β€” gets the reason for the directive. The why behind the what, iykyk. πŸ’…

πŸ¦‹ SOURCE πŸ¦‹

Test2's source code repository is literally right here: <https://github.com/Test-More/test-more/>. Go peek, bestie. 🫢

πŸ‘‘ MAINTAINERS πŸ‘‘

Chad Granum <exodist@cpan.org> is holding it down as maintainer. Iconic. πŸ‘‘

⭐ AUTHORS ⭐

Chad Granum <exodist@cpan.org> gets the author credit too β€” same legend, fr fr. ⭐

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


And that's the whole page, bestie β€” brought to you by perl v5.42.0, dated 2025-07-28, and it's Test2::Event::Plan(3). Bye, love you, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from