line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
#line 1 |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
75
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cmp; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
|
|
15
|
use overload |
8
|
|
|
|
|
|
|
'&' => \&make_all, |
9
|
|
|
|
|
|
|
'|' => \&make_any, |
10
|
|
|
|
|
|
|
'""' => \&string, |
11
|
1
|
|
|
1
|
|
6
|
fallback => 1, |
|
1
|
|
|
|
|
2
|
|
12
|
|
|
|
|
|
|
; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub import |
15
|
12
|
|
|
12
|
|
30
|
{ |
16
|
|
|
|
|
|
|
my $pkg = shift; |
17
|
12
|
|
|
|
|
30
|
|
18
|
12
|
50
|
|
|
|
75
|
my $callpkg = caller(); |
19
|
|
|
|
|
|
|
if ($callpkg =~ /^Test::Deep::/) |
20
|
1
|
|
|
1
|
|
240
|
{ |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
922
|
|
21
|
|
|
|
|
|
|
no strict 'refs'; |
22
|
12
|
|
|
|
|
20
|
|
|
12
|
|
|
|
|
3305
|
|
23
|
|
|
|
|
|
|
push @{$callpkg."::ISA"}, $pkg; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new |
28
|
50
|
|
|
50
|
0
|
77
|
{ |
29
|
|
|
|
|
|
|
my $pkg = shift; |
30
|
50
|
|
|
|
|
138
|
|
31
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
32
|
50
|
|
|
|
|
300
|
|
33
|
50
|
|
|
|
|
231
|
$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
|
12
|
|
|
12
|
0
|
23
|
{ |
126
|
|
|
|
|
|
|
my $self = shift; |
127
|
12
|
|
|
|
|
46
|
|
128
|
|
|
|
|
|
|
return $Test::Deep::Stack->getLast; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
1; |