line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
55
|
|
|
55
|
|
16325
|
use strict; |
|
55
|
|
|
|
|
75
|
|
|
55
|
|
|
|
|
2451
|
|
2
|
55
|
|
|
55
|
|
232
|
use warnings; |
|
55
|
|
|
|
|
64
|
|
|
55
|
|
|
|
|
1895
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Class::MethodInfo; |
5
|
55
|
|
|
55
|
|
225
|
use Carp; |
|
55
|
|
|
|
|
70
|
|
|
55
|
|
|
|
|
20730
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.48'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
121
|
|
|
121
|
1
|
398
|
my ( $class, %param ) = @_; |
11
|
|
|
|
|
|
|
my $self = bless { |
12
|
|
|
|
|
|
|
name => $param{ name }, |
13
|
121
|
|
100
|
|
|
804
|
type => $param{ type } || 'test', |
14
|
|
|
|
|
|
|
}, $class; |
15
|
121
|
100
|
|
|
|
318
|
unless ( defined $param{num_tests} ) { |
16
|
28
|
100
|
|
|
|
72
|
$param{ num_tests } = $self->is_type('test') ? 1 : 0; |
17
|
|
|
|
|
|
|
}; |
18
|
121
|
|
|
|
|
306
|
$self->num_tests( $param{num_tests} ); |
19
|
121
|
|
|
|
|
762
|
return $self; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
757
|
|
|
757
|
1
|
1349
|
sub name { shift->{name} }; |
23
|
|
|
|
|
|
|
|
24
|
757
|
|
|
757
|
1
|
1923
|
sub type { shift->{type} }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub num_tests { |
27
|
427
|
|
|
427
|
1
|
498
|
my ( $self, $n ) = @_; |
28
|
427
|
100
|
|
|
|
787
|
if ( defined $n ) { |
29
|
127
|
100
|
|
|
|
219
|
croak "$n not valid number of tests" |
30
|
|
|
|
|
|
|
unless $self->is_num_tests($n); |
31
|
126
|
|
|
|
|
374
|
$self->{ num_tests } = $n; |
32
|
|
|
|
|
|
|
}; |
33
|
426
|
|
|
|
|
847
|
return $self->{ num_tests }; |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub is_type { |
37
|
886
|
|
|
886
|
1
|
881
|
my ( $self, $type ) = @_; |
38
|
886
|
|
|
|
|
3140
|
return $self->{ type } eq $type; |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub is_method_type { |
42
|
52
|
|
|
52
|
1
|
76
|
my ( $self, $type ) = @_; |
43
|
52
|
|
|
|
|
264
|
return $type =~ m/^(startup|setup|test|teardown|shutdown)$/s; |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_num_tests { |
47
|
272
|
|
|
272
|
1
|
712
|
my ( $self, $num_tests ) = @_; |
48
|
272
|
|
|
|
|
1493
|
return $num_tests =~ m/^(no_plan)|(\+?\d+)$/s; |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
__END__ |