| 1 | 37 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 37 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package Test::Deep::Cmp 1.205; | ||||||||||
| 5 | |||||||||||
| 6 | use overload | ||||||||||
| 7 | 37 | ▶ | '&' => \&make_all, | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | '|' => \&make_any, | ||||||||||
| 9 | '""' => \&string, | ||||||||||
| 10 | fallback => 1, | ||||||||||
| 11 | 37 | ; | |||||||||
| 12 | |||||||||||
| 13 | 37 | ▶ | use Scalar::Util (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | sub import | ||||||||||
| 16 | 269 | ▶ | { | ||||||||
|
Subroutine
import: called CC=2 SCAR=7.0
| |||||||||||
| 17 | 269 | my $pkg = shift; | |||||||||
| 18 | |||||||||||
| 19 | 269 | my $callpkg = caller(); | |||||||||
| 20 | 269 | ▶ | if ($callpkg =~ /^Test::Deep::/) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | { | ||||||||||
| 22 | 37 | ▶ | no strict 'refs'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | |||||||||||
| 24 | 269 | push @{$callpkg."::ISA"}, $pkg; | |||||||||
| 25 | } | ||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | sub new | ||||||||||
| 29 | 2188 | ▶ | { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | 2188 | my $pkg = shift; | |||||||||
| 31 | |||||||||||
| 32 | 2188 | my $self = bless {}, $pkg; | |||||||||
| 33 | |||||||||||
| 34 | 2188 | $self->init(@_); | |||||||||
| 35 | 2188 | return $self; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | sub init | ||||||||||
| 39 | 1 | ▶ | { | ||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | sub make_all | ||||||||||
| 43 | 4 | ▶ | { | ||||||||
|
Subroutine
make_all: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 44 | 4 | my ($e1, $e2) = @_; | |||||||||
| 45 | |||||||||||
| 46 | 4 | return Test::Deep::all($e1, $e2); | |||||||||
| 47 | } | ||||||||||
| 48 | |||||||||||
| 49 | sub make_any | ||||||||||
| 50 | 6 | ▶ | { | ||||||||
|
Subroutine
make_any: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 51 | 6 | my ($e1, $e2) = @_; | |||||||||
| 52 | |||||||||||
| 53 | 6 | return Test::Deep::any($e1, $e2); | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | sub cmp | ||||||||||
| 57 | 0 | ▶ | { | ||||||||
|
Subroutine
cmp: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 58 | 0 | my ($a1, $a2, $rev) = @_; | |||||||||
| 59 | |||||||||||
| 60 | 0 | ▶ | ($a1, $a2) = ($a2, $a1) if $rev; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | |||||||||||
| 62 | 0 | return (overload::StrVal($a1) cmp overload::StrVal($a2)); | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | sub string | ||||||||||
| 66 | 82 | ▶ | { | ||||||||
|
Subroutine
string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 67 | 82 | my $self = shift; | |||||||||
| 68 | |||||||||||
| 69 | 82 | return overload::StrVal($self); | |||||||||
| 70 | } | ||||||||||
| 71 | |||||||||||
| 72 | sub render_stack | ||||||||||
| 73 | 186 | ▶ | { | ||||||||
|
Subroutine
render_stack: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 74 | 186 | my $self = shift; | |||||||||
| 75 | 186 | my $var = shift; | |||||||||
| 76 | |||||||||||
| 77 | 186 | return $var; | |||||||||
| 78 | } | ||||||||||
| 79 | |||||||||||
| 80 | sub renderExp | ||||||||||
| 81 | 62 | ▶ | { | ||||||||
|
Subroutine
renderExp: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 82 | 62 | my $self = shift; | |||||||||
| 83 | |||||||||||
| 84 | 62 | return $self->renderGot($self->{val}); | |||||||||
| 85 | } | ||||||||||
| 86 | |||||||||||
| 87 | sub renderGot | ||||||||||
| 88 | 124 | ▶ | { | ||||||||
|
Subroutine
renderGot: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 89 | 124 | my $self = shift; | |||||||||
| 90 | |||||||||||
| 91 | 124 | return Test::Deep::render_val(@_); | |||||||||
| 92 | } | ||||||||||
| 93 | |||||||||||
| 94 | sub reset_arrow | ||||||||||
| 95 | 184 | ▶ | { | ||||||||
|
Subroutine
reset_arrow: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 96 | 184 | return 1; | |||||||||
| 97 | } | ||||||||||
| 98 | |||||||||||
| 99 | sub data | ||||||||||
| 100 | 347 | ▶ | { | ||||||||
|
Subroutine
data: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 101 | 347 | my $self = shift; | |||||||||
| 102 | |||||||||||
| 103 | 347 | return $Test::Deep::Stack->getLast; | |||||||||
| 104 | } | ||||||||||
| 105 | |||||||||||
| 106 | 37 | 1; | |||||||||
| 107 | |||||||||||
| 108 | __END__ | ||||||||||