line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
#line 1 |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
125
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::MM; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub import |
8
|
1
|
|
|
1
|
|
2
|
{ |
9
|
|
|
|
|
|
|
my $self = shift; |
10
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
|
|
4
|
my ($pkg) = caller(); |
12
|
1
|
|
|
|
|
3
|
my $mpkg = $pkg."::Methods"; |
13
|
|
|
|
|
|
|
foreach my $attr (@_) |
14
|
4
|
100
|
|
|
|
15
|
{ |
15
|
|
|
|
|
|
|
if ($attr =~ /^[a-z]/) |
16
|
1
|
|
|
1
|
|
6
|
{ |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
229
|
|
17
|
2
|
|
|
|
|
2
|
no strict 'refs'; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
6
|
|
18
|
|
|
|
|
|
|
*{$mpkg."::$attr"} = \&{$attr}; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else |
21
|
2
|
|
|
|
|
4
|
{ |
22
|
2
|
|
|
|
|
4
|
my $get_name = $mpkg."::get$attr"; |
23
|
|
|
|
|
|
|
my $set_name = $mpkg."::set$attr"; |
24
|
114
|
|
|
114
|
|
389
|
my $get_sub = sub { |
25
|
2
|
|
|
|
|
8
|
return $_[0]->{$attr}; |
26
|
|
|
|
|
|
|
}; |
27
|
14
|
|
|
14
|
|
44
|
my $set_sub = sub { |
28
|
2
|
|
|
|
|
6
|
return $_[0]->{$attr} = $_[1]; |
29
|
|
|
|
|
|
|
}; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
7
|
{ |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
231
|
|
|
2
|
|
|
|
|
3
|
|
32
|
2
|
|
|
|
|
11
|
no strict 'refs'; |
33
|
2
|
|
|
|
|
10
|
*$get_name = $get_sub; |
34
|
2
|
|
|
|
|
4
|
*$set_name = $set_sub; |
|
2
|
|
|
|
|
559
|
|
35
|
|
|
|
|
|
|
push(@{$pkg."::ISA"}, $mpkg); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new |
42
|
14
|
|
|
14
|
0
|
21
|
{ |
43
|
|
|
|
|
|
|
my $pkg = shift; |
44
|
14
|
|
|
|
|
31
|
|
45
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
46
|
14
|
|
|
|
|
45
|
|
47
|
|
|
|
|
|
|
$self->init(@_); |
48
|
14
|
|
|
|
|
32
|
|
49
|
|
|
|
|
|
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub init |
53
|
14
|
|
|
14
|
0
|
17
|
{ |
54
|
|
|
|
|
|
|
my $self = shift; |
55
|
14
|
|
|
|
|
48
|
|
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; |