line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TAP::Spec::TestSet; |
2
|
|
|
|
|
|
|
BEGIN { |
3
|
2
|
|
|
2
|
|
95
|
$TAP::Spec::TestSet::AUTHORITY = 'cpan:ARODLAND'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$TAP::Spec::TestSet::VERSION = '0.10'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: A set of related TAP tests |
9
|
2
|
|
|
2
|
|
13
|
use Mouse; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
21
|
|
10
|
2
|
|
|
2
|
|
39661
|
use namespace::autoclean; |
|
2
|
|
|
|
|
39364
|
|
|
2
|
|
|
|
|
19
|
|
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
40611
|
use TAP::Spec::Body (); |
|
2
|
|
|
|
|
555
|
|
|
2
|
|
|
|
|
64
|
|
13
|
2
|
|
|
2
|
|
3673
|
use TAP::Spec::Plan (); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
62
|
|
14
|
2
|
|
|
2
|
|
13039
|
use TAP::Spec::Header (); |
|
2
|
|
|
|
|
187
|
|
|
2
|
|
|
|
|
86
|
|
15
|
2
|
|
|
2
|
|
4251
|
use TAP::Spec::Footer (); |
|
2
|
|
|
|
|
178
|
|
|
2
|
|
|
|
|
1391
|
|
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
|
4089
|
my $self = shift; |
85
|
|
|
|
|
|
|
|
86
|
4
|
50
|
|
|
|
43
|
return '' unless $self->plan; |
87
|
4
|
|
|
|
|
27
|
my $expected = $self->plan->number_of_tests; |
88
|
|
|
|
|
|
|
|
89
|
4
|
|
|
|
|
28
|
my @tests = $self->tests; |
90
|
4
|
50
|
|
|
|
18
|
return '' unless @tests == $expected; |
91
|
|
|
|
|
|
|
|
92
|
4
|
|
|
|
|
10
|
my $count = 1; |
93
|
4
|
|
|
|
|
8
|
for my $test (@tests) { |
94
|
6
|
100
|
|
|
|
28
|
return '' unless $test->passed; |
95
|
5
|
50
|
|
|
|
27
|
return '' unless $test->number == $count++; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
3
|
|
|
|
|
17
|
return 1; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
__END__ |