line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Data::Split::Backend::ValidateHash; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
23211
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
45
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
7
|
use Carp qw/confess/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
95
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
6
|
use parent 'Test::Data::Split::Backend::Hash'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
15
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub populate |
11
|
|
|
|
|
|
|
{ |
12
|
2
|
|
|
2
|
1
|
294
|
my ($self, $array_ref) = @_; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
6
|
my @l = @$array_ref; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
|
|
5
|
my $tests = $self->get_hash; |
17
|
|
|
|
|
|
|
|
18
|
2
|
50
|
|
|
|
10
|
if (@l & 0x1) |
19
|
|
|
|
|
|
|
{ |
20
|
0
|
|
|
|
|
0
|
confess("Input length is not even."); |
21
|
|
|
|
|
|
|
} |
22
|
2
|
|
|
|
|
7
|
while (@l) |
23
|
|
|
|
|
|
|
{ |
24
|
4
|
|
|
|
|
17
|
my $key = shift@l; |
25
|
4
|
|
|
|
|
5
|
my $val = shift@l; |
26
|
4
|
50
|
|
|
|
11
|
if (exists($tests->{$key})) |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
|
|
0
|
confess("Duplicate key '$key'!"); |
29
|
|
|
|
|
|
|
} |
30
|
4
|
|
|
|
|
12
|
$tests->{$key} = $self->validate_and_transform({id => $key, data => $val,}); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
|
|
6
|
return; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |