line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
24
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
92
|
|
2
|
3
|
|
|
3
|
|
25
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
123
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Deep::Methods 1.204; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
1237
|
use Test::Deep::Cmp; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
17
|
|
7
|
3
|
|
|
3
|
|
20
|
use Scalar::Util; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
1408
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init |
10
|
|
|
|
|
|
|
{ |
11
|
28
|
|
|
28
|
0
|
43
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# get them all into [$name,@args] => $value format |
14
|
28
|
|
|
|
|
42
|
my @methods; |
15
|
28
|
|
|
|
|
85
|
while (@_) |
16
|
|
|
|
|
|
|
{ |
17
|
46
|
|
|
|
|
79
|
my $name = shift; |
18
|
46
|
|
|
|
|
62
|
my $value = shift; |
19
|
46
|
100
|
|
|
|
191
|
push(@methods, |
20
|
|
|
|
|
|
|
[ |
21
|
|
|
|
|
|
|
ref($name) ? $name : [ $name ], |
22
|
|
|
|
|
|
|
$value |
23
|
|
|
|
|
|
|
] |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
} |
26
|
28
|
|
|
|
|
198
|
$self->{methods} = \@methods; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub descend |
30
|
|
|
|
|
|
|
{ |
31
|
27
|
|
|
27
|
0
|
45
|
my $self = shift; |
32
|
27
|
|
|
|
|
40
|
my $got = shift; |
33
|
|
|
|
|
|
|
|
34
|
27
|
|
|
|
|
73
|
my $data = $self->data; |
35
|
|
|
|
|
|
|
|
36
|
27
|
|
|
|
|
42
|
foreach my $method (@{$self->{methods}}) |
|
27
|
|
|
|
|
74
|
|
37
|
|
|
|
|
|
|
{ |
38
|
45
|
|
|
|
|
83
|
$data->{method} = $method; |
39
|
|
|
|
|
|
|
|
40
|
45
|
|
|
|
|
108
|
my ($call, $exp_res) = @$method; |
41
|
45
|
|
|
|
|
84
|
my ($name, @args) = @$call; |
42
|
|
|
|
|
|
|
|
43
|
45
|
|
|
|
|
61
|
local $@; |
44
|
|
|
|
|
|
|
|
45
|
45
|
|
|
|
|
58
|
my $got_res; |
46
|
45
|
100
|
|
|
|
86
|
if (! eval { $got_res = $self->call_method($got, $call); 1 }) { |
|
45
|
|
|
|
|
115
|
|
|
40
|
|
|
|
|
226
|
|
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
|
|
|
|
130
|
next if Test::Deep::descend($got_res, $exp_res); |
52
|
|
|
|
|
|
|
|
53
|
16
|
|
|
|
|
54
|
return 0; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
11
|
|
|
|
|
29
|
return 1; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub call_method |
60
|
|
|
|
|
|
|
{ |
61
|
45
|
|
|
45
|
0
|
69
|
my $self = shift; |
62
|
45
|
|
|
|
|
78
|
my ($got, $call) = @_; |
63
|
45
|
|
|
|
|
72
|
my ($name, @args) = @$call; |
64
|
|
|
|
|
|
|
|
65
|
45
|
|
|
|
|
235
|
return $got->$name(@args); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub render_stack |
69
|
|
|
|
|
|
|
{ |
70
|
15
|
|
|
15
|
0
|
24
|
my $self = shift; |
71
|
15
|
|
|
|
|
32
|
my ($var, $data) = @_; |
72
|
|
|
|
|
|
|
|
73
|
15
|
|
|
|
|
24
|
my $method = $data->{method}; |
74
|
15
|
|
|
|
|
30
|
my ($call, $expect) = @$method; |
75
|
15
|
|
|
|
|
30
|
my ($name, @args) = @$call; |
76
|
|
|
|
|
|
|
|
77
|
15
|
100
|
|
|
|
45
|
my $args = @args ? "(".join(", ", @args).")" : ""; |
78
|
15
|
|
|
|
|
44
|
$var .= "->$name$args"; |
79
|
|
|
|
|
|
|
|
80
|
15
|
|
|
|
|
40
|
return $var; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |