blib/lib/TAP/Parser/Result/Plan.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 5 / 5 totaltotal 100% 29 / 29 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/TAP/Parser/Result/Comment.pm ↑ Summary blib/lib/TAP/Parser/Result/Unknown.pm »
1 package TAP::Parser::Result::Plan;
2  
3 32 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 32 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 32 ▶use base 'TAP::Parser::Result';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 TAP::Parser::Result::Plan - Plan result token.
11  
12 =head1 VERSION
13  
14 Version 3.52
15  
16 =cut
17  
18 32 our $VERSION = '3.52';
19  
20 =head1 DESCRIPTION
21  
22 This is a subclass of L<TAP::Parser::Result>. A token of this class will be
23 returned if a plan line is encountered.
24  
25 1..1
26 ok 1 - woo hooo!
27  
28 C<1..1> is the plan. Gotta have a plan.
29  
30 =head1 OVERRIDDEN METHODS
31  
32 Mainly listed here to shut up the pitiful screams of the pod coverage tests.
33 They keep me awake at night.
34  
35 =over 4
36  
37 =item * C<as_string>
38  
39 =item * C<raw>
40  
41 =back
42  
43 =cut
44  
45 ##############################################################################
46  
47 =head2 Instance Methods
48  
49 =head3 C<plan>
50  
51 if ( $result->is_plan ) {
52 print $result->plan;
53 }
54  
55 This is merely a synonym for C<as_string>.
56  
57 =cut
58  
59 314 ▶sub plan { '1..' . shift->{tests_planned} }
Subroutine plan: called CC=1 SCAR=0.0
Pod documented
60  
61 ##############################################################################
62  
63 =head3 C<tests_planned>
64  
65 my $planned = $result->tests_planned;
66  
67 Returns the number of tests planned. For example, a plan of C<1..17> will
68 cause this method to return '17'.
69  
70 =cut
71  
72 389 ▶sub tests_planned { shift->{tests_planned} }
Subroutine tests_planned: called CC=1 SCAR=0.0
Pod documented
73  
74 ##############################################################################
75  
76 =head3 C<directive>
77  
78 my $directive = $plan->directive;
79  
80 If a SKIP directive is included with the plan, this method will return it.
81  
82 1..0 # SKIP: why bother?
83  
84 =cut
85  
86 57 ▶sub directive { shift->{directive} }
Subroutine directive: called CC=1 SCAR=0.0
Pod documented
87  
88 ##############################################################################
89  
90 =head3 C<has_skip>
91  
92 if ( $result->has_skip ) { ... }
93  
94 Returns a boolean value indicating whether or not this test has a SKIP
95 directive.
96  
97 =head3 C<explanation>
98  
99 my $explanation = $plan->explanation;
100  
101 If a SKIP directive was included with the plan, this method will return the
102 explanation, if any.
103  
104 =cut
105  
106 16 ▶sub explanation { shift->{explanation} }
Subroutine explanation: called CC=1 SCAR=0.0
Pod documented
107  
108 =head3 C<todo_list>
109  
110 my $todo = $result->todo_list;
111 for ( @$todo ) {
112 ...
113 }
114  
115 =cut
116  
117 312 ▶sub todo_list { shift->{todo_list} }
Subroutine todo_list: called CC=1 SCAR=0.0
Pod documented
118  
119 32 1;
« blib/lib/TAP/Parser/Result/Comment.pm ↑ Summary blib/lib/TAP/Parser/Result/Unknown.pm »