1Test2::Event::Plan(3) User Contributed Perl DocumentationTest2::Event::Plan(3)
2
3
4
6 Test2::Event::Plan - The event of a plan
7
9 Plan events are fired off whenever a plan is declared, done testing is
10 called, or a subtext completes.
11
13 use Test2::API qw/context/;
14 use Test2::Event::Plan;
15
16 my $ctx = context();
17
18 # Plan for 10 tests to run
19 my $event = $ctx->plan(10);
20
21 # Plan to skip all tests (will exit 0)
22 $ctx->plan(0, skip_all => "These tests need to be skipped");
23
25 $num = $plan->max
26 Get the number of expected tests
27
28 $dir = $plan->directive
29 Get the directive (such as TODO, skip_all, or no_plan).
30
31 $reason = $plan->reason
32 Get the reason for the directive.
33
35 The source code repository for Test2 can be found at
36 http://github.com/Test-More/test-more/.
37
39 Chad Granum <exodist@cpan.org>
40
42 Chad Granum <exodist@cpan.org>
43
45 Copyright 2020 Chad Granum <exodist@cpan.org>.
46
47 This program is free software; you can redistribute it and/or modify it
48 under the same terms as Perl itself.
49
50 See http://dev.perl.org/licenses/
51
52
53
54perl v5.34.0 2021-09-29 Test2::Event::Plan(3)