1 package TAP::Parser::Result::Plan;
5 use vars qw($VERSION @ISA);
6 use TAP::Parser::Result;
7 @ISA = 'TAP::Parser::Result';
11 TAP::Parser::Result::Plan - Plan result token.
23 This is a subclass of L<TAP::Parser::Result>. A token of this class will be
24 returned if a plan line is encountered.
29 C<1..1> is the plan. Gotta have a plan.
31 =head1 OVERRIDDEN METHODS
33 Mainly listed here to shut up the pitiful screams of the pod coverage tests.
34 They keep me awake at night.
46 ##############################################################################
48 =head2 Instance Methods
52 if ( $result->is_plan ) {
56 This is merely a synonym for C<as_string>.
60 sub plan { '1..' . shift->{tests_planned} }
62 ##############################################################################
64 =head3 C<tests_planned>
66 my $planned = $result->tests_planned;
68 Returns the number of tests planned. For example, a plan of C<1..17> will
69 cause this method to return '17'.
73 sub tests_planned { shift->{tests_planned} }
75 ##############################################################################
79 my $directive = $plan->directive;
81 If a SKIP directive is included with the plan, this method will return it.
83 1..0 # SKIP: why bother?
87 sub directive { shift->{directive} }
89 ##############################################################################
93 if ( $result->has_skip ) { ... }
95 Returns a boolean value indicating whether or not this test has a SKIP
100 my $explanation = $plan->explanation;
102 If a SKIP directive was included with the plan, this method will return the
107 sub explanation { shift->{explanation} }
111 my $todo = $result->todo_list;
118 sub todo_list { shift->{todo_list} }