line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
16
|
|
|
16
|
|
141
|
#line 1 |
|
16
|
|
|
|
|
27
|
|
|
16
|
|
|
|
|
456
|
|
2
|
16
|
|
|
16
|
|
74
|
use strict; |
|
16
|
|
|
|
|
29
|
|
|
16
|
|
|
|
|
1727
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::MM; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub import |
8
|
16
|
|
|
16
|
|
34
|
{ |
9
|
|
|
|
|
|
|
my $self = shift; |
10
|
16
|
|
|
|
|
51
|
|
11
|
16
|
|
|
|
|
43
|
my ($pkg) = caller(); |
12
|
16
|
|
|
|
|
44
|
my $mpkg = $pkg."::Methods"; |
13
|
|
|
|
|
|
|
foreach my $attr (@_) |
14
|
64
|
100
|
|
|
|
227
|
{ |
15
|
|
|
|
|
|
|
if ($attr =~ /^[a-z]/) |
16
|
16
|
|
|
16
|
|
90
|
{ |
|
16
|
|
|
|
|
56
|
|
|
16
|
|
|
|
|
2243
|
|
17
|
32
|
|
|
|
|
41
|
no strict 'refs'; |
|
32
|
|
|
|
|
212
|
|
|
32
|
|
|
|
|
74
|
|
18
|
|
|
|
|
|
|
*{$mpkg."::$attr"} = \&{$attr}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else |
21
|
32
|
|
|
|
|
77
|
{ |
22
|
32
|
|
|
|
|
64
|
my $get_name = $mpkg."::get$attr"; |
23
|
|
|
|
|
|
|
my $set_name = $mpkg."::set$attr"; |
24
|
1686
|
|
|
1686
|
|
6054
|
my $get_sub = sub { |
|
|
|
|
502
|
|
|
|
25
|
32
|
|
|
|
|
119
|
return $_[0]->{$attr}; |
26
|
|
|
|
|
|
|
}; |
27
|
67
|
|
|
67
|
|
256
|
my $set_sub = sub { |
28
|
32
|
|
|
|
|
82
|
return $_[0]->{$attr} = $_[1]; |
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
16
|
|
|
16
|
|
76
|
{ |
|
16
|
|
|
|
|
28
|
|
|
16
|
|
|
|
|
3218
|
|
|
32
|
|
|
|
|
43
|
|
32
|
32
|
|
|
|
|
159
|
no strict 'refs'; |
33
|
32
|
|
|
|
|
159
|
*$get_name = $get_sub; |
34
|
32
|
|
|
|
|
43
|
*$set_name = $set_sub; |
|
32
|
|
|
|
|
6105
|
|
35
|
|
|
|
|
|
|
push(@{$pkg."::ISA"}, $mpkg); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new |
42
|
67
|
|
|
67
|
0
|
131
|
{ |
43
|
|
|
|
|
|
|
my $pkg = shift; |
44
|
67
|
|
|
|
|
260
|
|
45
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
46
|
67
|
|
|
|
|
323
|
|
47
|
|
|
|
|
|
|
$self->init(@_); |
48
|
67
|
|
|
|
|
184
|
|
49
|
|
|
|
|
|
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub init |
53
|
67
|
|
|
67
|
0
|
119
|
{ |
54
|
|
|
|
|
|
|
my $self = shift; |
55
|
67
|
|
|
|
|
272
|
|
56
|
|
|
|
|
|
|
while (@_) |
57
|
0
|
|
0
|
|
|
|
{ |
58
|
|
|
|
|
|
|
my $name = shift || confess("No name"); |
59
|
0
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my $method = "set$name"; |
61
|
|
|
|
|
|
|
$self->$method(shift); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |