line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
117
|
|
2
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
111
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Deep::Methods 1.202; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1134
|
use Test::Deep::Cmp; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
12
|
|
7
|
3
|
|
|
3
|
|
18
|
use Scalar::Util; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1352
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init |
10
|
|
|
|
|
|
|
{ |
11
|
28
|
|
|
28
|
0
|
75
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# get them all into [$name,@args] => $value format |
14
|
28
|
|
|
|
|
46
|
my @methods; |
15
|
28
|
|
|
|
|
78
|
while (@_) |
16
|
|
|
|
|
|
|
{ |
17
|
46
|
|
|
|
|
70
|
my $name = shift; |
18
|
46
|
|
|
|
|
69
|
my $value = shift; |
19
|
46
|
100
|
|
|
|
204
|
push(@methods, |
20
|
|
|
|
|
|
|
[ |
21
|
|
|
|
|
|
|
ref($name) ? $name : [ $name ], |
22
|
|
|
|
|
|
|
$value |
23
|
|
|
|
|
|
|
] |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
28
|
|
|
|
|
195
|
$self->{methods} = \@methods; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub descend |
30
|
|
|
|
|
|
|
{ |
31
|
27
|
|
|
27
|
0
|
45
|
my $self = shift; |
32
|
27
|
|
|
|
|
41
|
my $got = shift; |
33
|
|
|
|
|
|
|
|
34
|
27
|
|
|
|
|
68
|
my $data = $self->data; |
35
|
|
|
|
|
|
|
|
36
|
27
|
|
|
|
|
40
|
foreach my $method (@{$self->{methods}}) |
|
27
|
|
|
|
|
69
|
|
37
|
|
|
|
|
|
|
{ |
38
|
45
|
|
|
|
|
86
|
$data->{method} = $method; |
39
|
|
|
|
|
|
|
|
40
|
45
|
|
|
|
|
88
|
my ($call, $exp_res) = @$method; |
41
|
45
|
|
|
|
|
80
|
my ($name, @args) = @$call; |
42
|
|
|
|
|
|
|
|
43
|
45
|
|
|
|
|
71
|
local $@; |
44
|
|
|
|
|
|
|
|
45
|
45
|
|
|
|
|
54
|
my $got_res; |
46
|
45
|
100
|
|
|
|
75
|
if (! eval { $got_res = $self->call_method($got, $call); 1 }) { |
|
45
|
|
|
|
|
106
|
|
|
40
|
|
|
|
|
231
|
|
47
|
5
|
50
|
|
|
|
100
|
die $@ unless $@ =~ /\ACan't locate object method "\Q$name"/; |
48
|
5
|
|
|
|
|
14
|
$got_res = $Test::Deep::DNE; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
45
|
100
|
|
|
|
156
|
next if Test::Deep::descend($got_res, $exp_res); |
52
|
|
|
|
|
|
|
|
53
|
16
|
|
|
|
|
61
|
return 0; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
11
|
|
|
|
|
26
|
return 1; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub call_method |
60
|
|
|
|
|
|
|
{ |
61
|
45
|
|
|
45
|
0
|
71
|
my $self = shift; |
62
|
45
|
|
|
|
|
84
|
my ($got, $call) = @_; |
63
|
45
|
|
|
|
|
82
|
my ($name, @args) = @$call; |
64
|
|
|
|
|
|
|
|
65
|
45
|
|
|
|
|
213
|
return $got->$name(@args); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub render_stack |
69
|
|
|
|
|
|
|
{ |
70
|
15
|
|
|
15
|
0
|
29
|
my $self = shift; |
71
|
15
|
|
|
|
|
25
|
my ($var, $data) = @_; |
72
|
|
|
|
|
|
|
|
73
|
15
|
|
|
|
|
28
|
my $method = $data->{method}; |
74
|
15
|
|
|
|
|
33
|
my ($call, $expect) = @$method; |
75
|
15
|
|
|
|
|
57
|
my ($name, @args) = @$call; |
76
|
|
|
|
|
|
|
|
77
|
15
|
100
|
|
|
|
44
|
my $args = @args ? "(".join(", ", @args).")" : ""; |
78
|
15
|
|
|
|
|
40
|
$var .= "->$name$args"; |
79
|
|
|
|
|
|
|
|
80
|
15
|
|
|
|
|
44
|
return $var; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |