line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TAP::Spec::TestSet; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
76
|
$TAP::Spec::TestSet::AUTHORITY = 'cpan:ARODLAND'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$TAP::Spec::TestSet::VERSION = '0.07_991'; # TRIAL |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: A set of related TAP tests |
9
|
2
|
|
|
2
|
|
10
|
use Mouse; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
16
|
|
10
|
2
|
|
|
2
|
|
1471
|
use namespace::autoclean; |
|
2
|
|
|
|
|
9886
|
|
|
2
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
734
|
use TAP::Spec::Body (); |
|
2
|
|
|
|
|
103
|
|
|
2
|
|
|
|
|
50
|
|
13
|
2
|
|
|
2
|
|
827
|
use TAP::Spec::Plan (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
41
|
|
14
|
2
|
|
|
2
|
|
630
|
use TAP::Spec::Header (); |
|
2
|
|
|
|
|
88
|
|
|
2
|
|
|
|
|
41
|
|
15
|
2
|
|
|
2
|
|
676
|
use TAP::Spec::Footer (); |
|
2
|
|
|
|
|
90
|
|
|
2
|
|
|
|
|
521
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has 'body' => ( |
19
|
|
|
|
|
|
|
is => 'rw', |
20
|
|
|
|
|
|
|
isa => 'TAP::Spec::Body', |
21
|
|
|
|
|
|
|
handles => { |
22
|
|
|
|
|
|
|
lines => 'lines', |
23
|
|
|
|
|
|
|
tests => 'tests', |
24
|
|
|
|
|
|
|
body_comments => 'comments', |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
required => 1, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
has 'plan' => ( |
31
|
|
|
|
|
|
|
is => 'rw', |
32
|
|
|
|
|
|
|
isa => 'TAP::Spec::Plan', |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
has version => ( |
37
|
|
|
|
|
|
|
is => 'rw', |
38
|
|
|
|
|
|
|
isa => 'Int', |
39
|
|
|
|
|
|
|
lazy => 1, |
40
|
|
|
|
|
|
|
default => sub { |
41
|
|
|
|
|
|
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
if( my $v = $self->header->version ) { |
44
|
|
|
|
|
|
|
return $v->version_number; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
else { |
47
|
|
|
|
|
|
|
return 12; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
has 'header' => ( |
54
|
|
|
|
|
|
|
is => 'rw', |
55
|
|
|
|
|
|
|
isa => 'TAP::Spec::Header', |
56
|
|
|
|
|
|
|
handles => { |
57
|
|
|
|
|
|
|
header_comments => 'comments', |
58
|
|
|
|
|
|
|
}, |
59
|
|
|
|
|
|
|
required => 1, |
60
|
|
|
|
|
|
|
); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
has 'footer' => ( |
64
|
|
|
|
|
|
|
is => 'rw', |
65
|
|
|
|
|
|
|
isa => 'TAP::Spec::Footer', |
66
|
|
|
|
|
|
|
handles => { |
67
|
|
|
|
|
|
|
footer_comments => 'comments', |
68
|
|
|
|
|
|
|
}, |
69
|
|
|
|
|
|
|
required => 1, |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub as_tap { |
74
|
0
|
|
|
0
|
1
|
0
|
my ($self) = @_; |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
0
|
return $self->plan->as_tap() . |
77
|
|
|
|
|
|
|
$self->header->as_tap() . |
78
|
|
|
|
|
|
|
$self->body->as_tap() . |
79
|
|
|
|
|
|
|
$self->footer->as_tap(); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub passed { |
84
|
4
|
|
|
4
|
1
|
2327
|
my $self = shift; |
85
|
|
|
|
|
|
|
|
86
|
4
|
50
|
|
|
|
24
|
return '' unless $self->plan; |
87
|
4
|
|
|
|
|
16
|
my $expected = $self->plan->number_of_tests; |
88
|
|
|
|
|
|
|
|
89
|
4
|
|
|
|
|
13
|
my @tests = $self->tests; |
90
|
4
|
50
|
|
|
|
9
|
return '' unless @tests == $expected; |
91
|
|
|
|
|
|
|
|
92
|
4
|
|
|
|
|
8
|
my $count = 1; |
93
|
4
|
|
|
|
|
8
|
for my $test (@tests) { |
94
|
6
|
100
|
|
|
|
14
|
return '' unless $test->passed; |
95
|
5
|
50
|
|
|
|
16
|
return '' unless $test->number == $count++; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
3
|
|
|
|
|
10
|
return 1; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
__END__ |