line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
198
|
#line 1 |
|
12
|
|
|
|
|
22
|
|
|
12
|
|
|
|
|
387
|
|
2
|
12
|
|
|
12
|
|
61
|
use strict; |
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
1419
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cmp; |
6
|
|
|
|
|
|
|
|
7
|
12
|
|
|
|
|
175
|
use overload |
8
|
|
|
|
|
|
|
'&' => \&make_all, |
9
|
|
|
|
|
|
|
'|' => \&make_any, |
10
|
|
|
|
|
|
|
'""' => \&string, |
11
|
12
|
|
|
12
|
|
61
|
fallback => 1, |
|
12
|
|
|
|
|
174
|
|
12
|
|
|
|
|
|
|
; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
96
|
|
|
96
|
|
168
|
{ |
16
|
|
|
|
|
|
|
my $pkg = shift; |
17
|
96
|
|
|
|
|
192
|
|
18
|
96
|
50
|
|
|
|
478
|
my $callpkg = caller(); |
19
|
|
|
|
|
|
|
if ($callpkg =~ /^Test::Deep::/) |
20
|
12
|
|
|
12
|
|
1885
|
{ |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
9619
|
|
21
|
|
|
|
|
|
|
no strict 'refs'; |
22
|
96
|
|
|
|
|
120
|
|
|
96
|
|
|
|
|
25717
|
|
23
|
|
|
|
|
|
|
push @{$callpkg."::ISA"}, $pkg; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new |
28
|
709
|
|
|
709
|
0
|
1045
|
{ |
29
|
|
|
|
|
|
|
my $pkg = shift; |
30
|
709
|
|
|
|
|
3538
|
|
31
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
32
|
709
|
|
|
|
|
3678
|
|
33
|
709
|
|
|
|
|
4111
|
$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
|
469
|
|
|
469
|
0
|
736
|
{ |
92
|
|
|
|
|
|
|
my $self = shift; |
93
|
469
|
|
|
|
|
7743
|
|
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
|
201
|
|
|
201
|
0
|
268
|
{ |
126
|
|
|
|
|
|
|
my $self = shift; |
127
|
201
|
|
|
|
|
1014
|
|
128
|
|
|
|
|
|
|
return $Test::Deep::Stack->getLast; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |