line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
22
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
92
|
|
2
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
110
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Deep::Any 1.202; |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use Scalar::Util (); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
57
|
|
7
|
3
|
|
|
3
|
|
381
|
use Test::Deep::Cmp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
34
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init |
10
|
|
|
|
|
|
|
{ |
11
|
10
|
|
|
10
|
0
|
13
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my @list = map { |
14
|
10
|
|
|
|
|
21
|
(Scalar::Util::blessed($_) && $_->isa('Test::Deep::Any')) |
15
|
18
|
100
|
100
|
|
|
121
|
? @{ $_->{val} } |
|
1
|
|
|
|
|
4
|
|
16
|
|
|
|
|
|
|
: $_ |
17
|
|
|
|
|
|
|
} @_; |
18
|
|
|
|
|
|
|
|
19
|
10
|
|
|
|
|
121
|
$self->{val} = \@list; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub descend |
23
|
|
|
|
|
|
|
{ |
24
|
9
|
|
|
9
|
0
|
17
|
my $self = shift; |
25
|
9
|
|
|
|
|
13
|
my $got = shift; |
26
|
|
|
|
|
|
|
|
27
|
9
|
|
|
|
|
13
|
foreach my $cmp (@{$self->{val}}) |
|
9
|
|
|
|
|
19
|
|
28
|
|
|
|
|
|
|
{ |
29
|
14
|
100
|
|
|
|
33
|
return 1 if Test::Deep::eq_deeply_cache($got, $cmp); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
11
|
return 0; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub renderExp |
36
|
|
|
|
|
|
|
{ |
37
|
4
|
|
|
4
|
0
|
5
|
my $self = shift; |
38
|
|
|
|
|
|
|
|
39
|
4
|
|
|
|
|
7
|
my @expect = map {; Test::Deep::wrap($_) } @{ $self->{val} }; |
|
8
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
11
|
|
40
|
4
|
|
|
|
|
7
|
my $things = join(", ", map {$_->renderExp} @expect); |
|
8
|
|
|
|
|
20
|
|
41
|
|
|
|
|
|
|
|
42
|
4
|
|
|
|
|
28
|
return "Any of ( $things )"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub diagnostics |
46
|
|
|
|
|
|
|
{ |
47
|
4
|
|
|
4
|
0
|
7
|
my $self = shift; |
48
|
4
|
|
|
|
|
8
|
my ($where, $last) = @_; |
49
|
|
|
|
|
|
|
|
50
|
4
|
|
|
|
|
13
|
my $got = $self->renderGot($last->{got}); |
51
|
4
|
|
|
|
|
10
|
my $exp = $self->renderExp; |
52
|
|
|
|
|
|
|
|
53
|
4
|
|
|
|
|
14
|
my $diag = <
|
54
|
|
|
|
|
|
|
Comparing $where with Any |
55
|
|
|
|
|
|
|
got : $got |
56
|
|
|
|
|
|
|
expected : $exp |
57
|
|
|
|
|
|
|
EOM |
58
|
|
|
|
|
|
|
|
59
|
4
|
|
|
|
|
28
|
$diag =~ s/\n+$/\n/; |
60
|
4
|
|
|
|
|
11
|
return $diag; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
4; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |