line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
12
|
|
|
12
|
|
66
|
#line 1 |
|
12
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
447
|
|
2
|
12
|
|
|
12
|
|
62
|
use strict; |
|
12
|
|
|
|
|
25
|
|
|
12
|
|
|
|
|
391
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::HashKeysOnly; |
6
|
12
|
|
|
12
|
|
68
|
|
|
12
|
|
|
|
|
27
|
|
|
12
|
|
|
|
|
81
|
|
7
|
|
|
|
|
|
|
use Test::Deep::Ref; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init |
10
|
67
|
|
|
67
|
0
|
115
|
{ |
11
|
|
|
|
|
|
|
my $self = shift; |
12
|
67
|
|
|
|
|
102
|
|
13
|
67
|
|
|
|
|
211
|
my %keys; |
14
|
67
|
|
|
|
|
1282
|
@keys{@_} = (); |
15
|
67
|
|
|
|
|
404
|
$self->{val} = \%keys; |
16
|
|
|
|
|
|
|
$self->{keys} = [sort @_]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub descend |
20
|
67
|
|
|
67
|
0
|
117
|
{ |
21
|
67
|
|
|
|
|
97
|
my $self = shift; |
22
|
|
|
|
|
|
|
my $hash = shift; |
23
|
67
|
|
|
|
|
272
|
|
24
|
67
|
|
|
|
|
168
|
my $data = $self->data; |
25
|
67
|
|
|
|
|
108
|
my $exp = $self->{val}; |
26
|
67
|
|
|
|
|
273
|
my %got; |
27
|
|
|
|
|
|
|
@got{keys %$hash} = (); |
28
|
67
|
|
|
|
|
134
|
|
29
|
|
|
|
|
|
|
my @missing; |
30
|
|
|
|
|
|
|
my @extra; |
31
|
67
|
|
|
|
|
310
|
|
32
|
|
|
|
|
|
|
while (my ($key, $value) = each %$exp) |
33
|
173
|
50
|
|
|
|
1132
|
{ |
34
|
|
|
|
|
|
|
if (exists $got{$key}) |
35
|
173
|
|
|
|
|
650
|
{ |
36
|
|
|
|
|
|
|
delete $got{$key}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
else |
39
|
0
|
|
|
|
|
0
|
{ |
40
|
|
|
|
|
|
|
push(@missing, $key); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
} |
43
|
67
|
|
|
|
|
90
|
|
44
|
67
|
50
|
33
|
|
|
236
|
my @diags; |
45
|
|
|
|
|
|
|
if (@missing and (not $self->ignoreMissing)) |
46
|
0
|
|
|
|
|
0
|
{ |
47
|
|
|
|
|
|
|
push(@diags, "Missing: ".nice_list(\@missing)); |
48
|
|
|
|
|
|
|
} |
49
|
67
|
50
|
33
|
|
|
220
|
|
50
|
|
|
|
|
|
|
if (%got and (not $self->ignoreExtra)) |
51
|
0
|
|
|
|
|
0
|
{ |
52
|
|
|
|
|
|
|
push(@diags, "Extra: ".nice_list([keys %got])); |
53
|
|
|
|
|
|
|
} |
54
|
67
|
50
|
|
|
|
168
|
|
55
|
|
|
|
|
|
|
if (@diags) |
56
|
0
|
|
|
|
|
0
|
{ |
57
|
0
|
|
|
|
|
0
|
$data->{diag} = join("\n", @diags); |
58
|
|
|
|
|
|
|
return 0; |
59
|
|
|
|
|
|
|
} |
60
|
67
|
|
|
|
|
297
|
|
61
|
|
|
|
|
|
|
return 1; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub diagnostics |
65
|
0
|
|
|
0
|
0
|
|
{ |
66
|
0
|
|
|
|
|
|
my $self = shift; |
67
|
|
|
|
|
|
|
my ($where, $last) = @_; |
68
|
0
|
0
|
|
|
|
|
|
69
|
|
|
|
|
|
|
my $type = $self->{IgnoreDupes} ? "Set" : "Bag"; |
70
|
0
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
|
my $error = $last->{diag}; |
72
|
|
|
|
|
|
|
my $diag = <
|
73
|
|
|
|
|
|
|
Comparing hash keys of $where |
74
|
|
|
|
|
|
|
$error |
75
|
|
|
|
|
|
|
EOM |
76
|
0
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
return $diag; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub nice_list |
81
|
0
|
|
|
0
|
0
|
|
{ |
82
|
|
|
|
|
|
|
my $list = shift; |
83
|
0
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return join(", ", |
85
|
|
|
|
|
|
|
(map {"'$_'"} sort @$list), |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub ignoreMissing |
90
|
0
|
|
|
0
|
0
|
|
{ |
91
|
|
|
|
|
|
|
return 0; |
92
|
|
|
|
|
|
|
} |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub ignoreExtra |
95
|
0
|
|
|
0
|
0
|
|
{ |
96
|
|
|
|
|
|
|
return 0; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
package Test::Deep::SuperHashKeysOnly; |
100
|
12
|
|
|
12
|
|
149
|
|
|
12
|
|
|
|
|
28
|
|
|
12
|
|
|
|
|
215
|
|
101
|
|
|
|
|
|
|
use base 'Test::Deep::HashKeysOnly'; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub ignoreMissing |
104
|
0
|
|
|
0
|
|
|
{ |
105
|
|
|
|
|
|
|
return 0; |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub ignoreExtra |
109
|
0
|
|
|
0
|
|
|
{ |
110
|
|
|
|
|
|
|
return 1; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
package Test::Deep::SubHashKeysOnly; |
114
|
12
|
|
|
12
|
|
70
|
|
|
12
|
|
|
|
|
26
|
|
|
12
|
|
|
|
|
142
|
|
115
|
|
|
|
|
|
|
use base 'Test::Deep::HashKeysOnly'; |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub ignoreMissing |
118
|
0
|
|
|
0
|
|
|
{ |
119
|
|
|
|
|
|
|
return 1; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub ignoreExtra |
123
|
0
|
|
|
0
|
|
|
{ |
124
|
|
|
|
|
|
|
return 0; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
1; |