line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
56
|
|
|
56
|
|
76761
|
use strict; |
|
56
|
|
|
|
|
130
|
|
|
56
|
|
|
|
|
1838
|
|
2
|
56
|
|
|
56
|
|
294
|
use warnings; |
|
56
|
|
|
|
|
112
|
|
|
56
|
|
|
|
|
2123
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Class::MethodInfo; |
5
|
56
|
|
|
56
|
|
309
|
use Carp; |
|
56
|
|
|
|
|
123
|
|
|
56
|
|
|
|
|
27715
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.52'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
131
|
|
|
131
|
1
|
589
|
my ( $class, %param ) = @_; |
11
|
|
|
|
|
|
|
my $self = bless { |
12
|
|
|
|
|
|
|
name => $param{ name }, |
13
|
131
|
|
100
|
|
|
774
|
type => $param{ type } || 'test', |
14
|
|
|
|
|
|
|
}, $class; |
15
|
131
|
100
|
|
|
|
383
|
unless ( defined $param{num_tests} ) { |
16
|
28
|
100
|
|
|
|
82
|
$param{ num_tests } = $self->is_type('test') ? 1 : 0; |
17
|
|
|
|
|
|
|
}; |
18
|
131
|
|
|
|
|
383
|
$self->num_tests( $param{num_tests} ); |
19
|
131
|
|
|
|
|
778
|
return $self; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
807
|
|
|
807
|
1
|
1787
|
sub name { shift->{name} }; |
23
|
|
|
|
|
|
|
|
24
|
807
|
|
|
807
|
1
|
2111
|
sub type { shift->{type} }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub num_tests { |
27
|
457
|
|
|
457
|
1
|
896
|
my ( $self, $n ) = @_; |
28
|
457
|
100
|
|
|
|
957
|
if ( defined $n ) { |
29
|
137
|
100
|
|
|
|
303
|
croak "$n not valid number of tests" |
30
|
|
|
|
|
|
|
unless $self->is_num_tests($n); |
31
|
136
|
|
|
|
|
438
|
$self->{ num_tests } = $n; |
32
|
|
|
|
|
|
|
}; |
33
|
456
|
|
|
|
|
1035
|
return $self->{ num_tests }; |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub is_type { |
37
|
936
|
|
|
936
|
1
|
1566
|
my ( $self, $type ) = @_; |
38
|
936
|
|
|
|
|
2854
|
return $self->{ type } eq $type; |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub is_method_type { |
42
|
52
|
|
|
52
|
1
|
120
|
my ( $self, $type ) = @_; |
43
|
52
|
|
|
|
|
285
|
return $type =~ m/^(startup|setup|test|teardown|shutdown)$/s; |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub is_num_tests { |
47
|
292
|
|
|
292
|
1
|
548
|
my ( $self, $num_tests ) = @_; |
48
|
292
|
|
|
|
|
1593
|
return $num_tests =~ m/^(no_plan)|(\+?\d+)$/s; |
49
|
|
|
|
|
|
|
}; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
__END__ |