| 1 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package Test::Deep::Any 1.205; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use Test::Deep::Cmp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | sub init | ||||||||||||||||||||||||||||
| 10 | 11 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 11 | my $self = shift; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | my @list = map { | ||||||||||||||||||||||||||||
| 14 | 11 | (Scalar::Util::blessed($_) && $_->isa('Test::Deep::Any')) | |||||||||||||||||||||||||||
| 15 | 19 | ▶ | ? @{ $_->{val} } | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
builtin::blessed($_) and $_->isa("Test::Deep::Any")
MC/DC100%2/2
builtin::blessed($_) and $_->isa("Test::Deep::Any")
builtin::blessed($_)
$_->isa("Test::Deep::Any")
Truth table100%3/3
A and B
A= builtin::blessed($_)B= $_->isa("Test::Deep::Any")
| |||||||||||||||||||||||||||||
| 16 | : $_ | ||||||||||||||||||||||||||||
| 17 | } @_; | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 11 | $self->{val} = \@list; | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | sub descend | ||||||||||||||||||||||||||||
| 23 | 9 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
descend: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 24 | 9 | my $self = shift; | |||||||||||||||||||||||||||
| 25 | 9 | my $got = shift; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 9 | foreach my $cmp (@{$self->{val}}) | |||||||||||||||||||||||||||
| 28 | { | ||||||||||||||||||||||||||||
| 29 | 14 | ▶ | return 1 if Test::Deep::eq_deeply_cache($got, $cmp); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 4 | return 0; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | sub renderExp | ||||||||||||||||||||||||||||
| 36 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
renderExp: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 37 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 4 | my @expect = map {; Test::Deep::wrap($_) } @{ $self->{val} }; | |||||||||||||||||||||||||||
| 40 | 4 | my $things = join(", ", map {$_->renderExp} @expect); | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 4 | return "Any of ( $things )"; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | sub diagnostics | ||||||||||||||||||||||||||||
| 46 | 4 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
diagnostics: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 47 | 4 | my $self = shift; | |||||||||||||||||||||||||||
| 48 | 4 | my ($where, $last) = @_; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 4 | my $got = $self->renderGot($last->{got}); | |||||||||||||||||||||||||||
| 51 | 4 | my $exp = $self->renderExp; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 4 | my $diag = <<EOM; | |||||||||||||||||||||||||||
| 54 | Comparing $where with Any | ||||||||||||||||||||||||||||
| 55 | got : $got | ||||||||||||||||||||||||||||
| 56 | expected : $exp | ||||||||||||||||||||||||||||
| 57 | EOM | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 4 | $diag =~ s/\n+$/\n/; | |||||||||||||||||||||||||||
| 60 | 4 | return $diag; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | 4 | 4; | |||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | __END__ | ||||||||||||||||||||||||||||