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