line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types::HashRef; |
2
|
4
|
|
|
4
|
|
14
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
90
|
|
3
|
4
|
|
|
4
|
|
11
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
80
|
|
4
|
4
|
|
|
4
|
|
15
|
use parent "Test::RandomCheck::Types"; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
15
|
|
5
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
6
|
4
|
|
|
|
|
22
|
ro => [qw(min max key_type value_type)], |
7
|
|
|
|
|
|
|
rw => [qw(_list_type)], |
8
|
4
|
|
|
4
|
|
233
|
); |
|
4
|
|
|
|
|
6
|
|
9
|
4
|
|
|
4
|
|
304
|
use Test::RandomCheck::Types::List; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
145
|
|
10
|
4
|
|
|
4
|
|
13
|
use Test::RandomCheck::Types::Reference; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
22
|
|
11
|
4
|
|
|
4
|
|
1457
|
use Test::RandomCheck::Types::Product; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
737
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
|
|
my $class = shift; |
15
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $kv = Test::RandomCheck::Types::Reference->new( |
18
|
|
|
|
|
|
|
type => product ($self->key_type, $self->value_type) |
19
|
|
|
|
|
|
|
); |
20
|
0
|
|
|
|
|
|
my $inner_type = list ($kv, $self->min, $self->max); |
21
|
0
|
|
|
|
|
|
$self->_list_type($inner_type); |
22
|
0
|
|
|
|
|
|
$self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub arbitrary { |
26
|
0
|
|
|
0
|
|
|
my $self = shift; |
27
|
0
|
|
|
0
|
|
|
$self->_list_type->arbitrary->map(sub { +{map { @$_ } @_} }); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub memoize_key { |
31
|
0
|
|
|
0
|
|
|
my ($self, $hash_ref) = @_; |
32
|
|
|
|
|
|
|
$self->_list_type->memoize_key( |
33
|
0
|
|
|
|
|
|
map { [$_ => $hash_ref->{$_}] } keys %$hash_ref |
|
0
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |