line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
71
|
#line 1 |
|
12
|
|
|
|
|
160
|
|
|
12
|
|
|
|
|
523
|
|
2
|
12
|
|
|
12
|
|
67
|
use strict; |
|
12
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
975
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cmp; |
6
|
|
|
|
|
|
|
|
7
|
12
|
|
|
|
|
298
|
use overload |
8
|
|
|
|
|
|
|
'&' => \&make_all, |
9
|
|
|
|
|
|
|
'|' => \&make_any, |
10
|
|
|
|
|
|
|
'""' => \&string, |
11
|
12
|
|
|
12
|
|
69
|
fallback => 1, |
|
12
|
|
|
|
|
25
|
|
12
|
|
|
|
|
|
|
; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
112
|
|
|
112
|
|
296
|
{ |
16
|
|
|
|
|
|
|
my $pkg = shift; |
17
|
112
|
|
|
|
|
427
|
|
18
|
112
|
50
|
|
|
|
658
|
my $callpkg = caller(); |
19
|
|
|
|
|
|
|
if ($callpkg =~ /^Test::Deep::/) |
20
|
12
|
|
|
12
|
|
2013
|
{ |
|
12
|
|
|
|
|
31
|
|
|
12
|
|
|
|
|
8478
|
|
21
|
|
|
|
|
|
|
no strict 'refs'; |
22
|
112
|
|
|
|
|
158
|
|
|
112
|
|
|
|
|
35946
|
|
23
|
|
|
|
|
|
|
push @{$callpkg."::ISA"}, $pkg; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new |
28
|
568
|
|
|
568
|
0
|
853
|
{ |
29
|
|
|
|
|
|
|
my $pkg = shift; |
30
|
568
|
|
|
|
|
1427
|
|
31
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
32
|
568
|
|
|
|
|
1922
|
|
33
|
568
|
|
|
|
|
2099
|
$self->init(@_); |
34
|
|
|
|
|
|
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
0
|
0
|
0
|
sub init |
38
|
|
|
|
|
|
|
{ |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub make_all |
42
|
0
|
|
|
0
|
0
|
0
|
{ |
43
|
|
|
|
|
|
|
my ($e1, $e2) = @_; |
44
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
45
|
|
|
|
|
|
|
if (UNIVERSAL::isa($e1, "Test::Deep::All")) |
46
|
0
|
|
|
|
|
0
|
{ |
47
|
0
|
|
|
|
|
0
|
$e1->add($e2); |
48
|
|
|
|
|
|
|
return $e1; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
elsif(UNIVERSAL::isa($e2, "Test::Deep::All")) |
51
|
0
|
|
|
|
|
0
|
{ |
52
|
0
|
|
|
|
|
0
|
$e2->add($e1); |
53
|
|
|
|
|
|
|
return $e2; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
else |
56
|
0
|
|
|
|
|
0
|
{ |
57
|
|
|
|
|
|
|
return Test::Deep::all($e1, $e2); |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub make_any |
62
|
0
|
|
|
0
|
0
|
0
|
{ |
63
|
|
|
|
|
|
|
my ($e1, $e2) = @_; |
64
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
65
|
|
|
|
|
|
|
if (UNIVERSAL::isa($e1, "Test::Deep::Any")) |
66
|
0
|
|
|
|
|
0
|
{ |
67
|
0
|
|
|
|
|
0
|
$e1->add($e2); |
68
|
|
|
|
|
|
|
return $e1; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
elsif(UNIVERSAL::isa($e2, "Test::Deep::Any")) |
71
|
0
|
|
|
|
|
0
|
{ |
72
|
0
|
|
|
|
|
0
|
$e2->add($e1); |
73
|
|
|
|
|
|
|
return $e2; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
else |
76
|
0
|
|
|
|
|
0
|
{ |
77
|
|
|
|
|
|
|
return Test::Deep::any($e1, $e2); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub cmp |
82
|
0
|
|
|
0
|
0
|
0
|
{ |
83
|
|
|
|
|
|
|
my ($a1, $a2, $rev) = @_; |
84
|
0
|
0
|
|
|
|
0
|
|
85
|
|
|
|
|
|
|
($a1, $a2) = ($a2, $a1) if $rev; |
86
|
0
|
|
|
|
|
0
|
|
87
|
|
|
|
|
|
|
return (overload::StrVal($a1) cmp overload::StrVal($a2)); |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub string |
91
|
0
|
|
|
0
|
0
|
0
|
{ |
92
|
|
|
|
|
|
|
my $self = shift; |
93
|
0
|
|
|
|
|
0
|
|
94
|
|
|
|
|
|
|
return overload::StrVal($self); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub render_stack |
98
|
0
|
|
|
0
|
0
|
0
|
{ |
99
|
0
|
|
|
|
|
0
|
my $self = shift; |
100
|
|
|
|
|
|
|
my $var = shift; |
101
|
0
|
|
|
|
|
0
|
|
102
|
|
|
|
|
|
|
return $var; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub renderExp |
106
|
0
|
|
|
0
|
0
|
0
|
{ |
107
|
|
|
|
|
|
|
my $self = shift; |
108
|
0
|
|
|
|
|
0
|
|
109
|
|
|
|
|
|
|
return $self->renderGot($self->{val}); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub renderGot |
113
|
0
|
|
|
0
|
0
|
0
|
{ |
114
|
|
|
|
|
|
|
my $self = shift; |
115
|
0
|
|
|
|
|
0
|
|
116
|
|
|
|
|
|
|
return Test::Deep::render_val(@_); |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub reset_arrow |
120
|
0
|
|
|
0
|
0
|
0
|
{ |
121
|
|
|
|
|
|
|
return 1; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub data |
125
|
83
|
|
|
83
|
0
|
124
|
{ |
126
|
|
|
|
|
|
|
my $self = shift; |
127
|
83
|
|
|
|
|
326
|
|
128
|
|
|
|
|
|
|
return $Test::Deep::Stack->getLast; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |