line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Object::Test; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
85
|
|
4
|
2
|
|
|
2
|
|
11
|
use Carp (); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
26
|
|
5
|
2
|
|
|
2
|
|
8
|
use Scalar::Util (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
69
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use vars qw{$VERSION}; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
128
|
|
8
|
|
|
|
|
|
|
BEGIN { |
9
|
2
|
|
|
2
|
|
967
|
$VERSION = '0.07'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
1
|
|
|
1
|
0
|
3
|
my $class = shift; |
21
|
1
|
|
|
|
|
9
|
my $self = bless { @_ }, $class; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
1
|
50
|
|
|
|
7
|
unless ( _CLASS($self->class) ) { |
25
|
0
|
|
|
|
|
0
|
Carp::croak("Did not provide a valid test class"); |
26
|
|
|
|
|
|
|
} |
27
|
1
|
50
|
|
|
|
5
|
unless ( _CODELIKE($self->code) ) { |
28
|
0
|
|
|
|
|
0
|
Carp::croak("Did not provide a valid CODE or callable object"); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
4
|
$self; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub class { |
35
|
2
|
|
|
2
|
0
|
21
|
$_[0]->{class}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub tests { |
39
|
0
|
|
|
0
|
0
|
0
|
$_[0]->{tests}; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub code { |
43
|
2
|
|
|
2
|
0
|
9
|
$_[0]->{code}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub run { |
54
|
1
|
|
|
1
|
0
|
3
|
$_[0]->code->( $_[1] ); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _CLASS ($) { |
67
|
1
|
50
|
33
|
1
|
|
30
|
(defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*$/s) ? $_[0] : undef; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub _CODELIKE { |
71
|
1
|
0
|
0
|
1
|
|
785
|
(Scalar::Util::reftype($_[0])||'') eq 'CODE' |
|
|
50
|
50
|
|
|
|
|
72
|
|
|
|
|
|
|
or |
73
|
|
|
|
|
|
|
Scalar::Util::blessed($_[0]) and overload::Method($_[0],'&{}') |
74
|
|
|
|
|
|
|
? $_[0] : undef; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|