line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types::HashRef; |
2
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
81
|
|
3
|
4
|
|
|
4
|
|
11
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
70
|
|
4
|
4
|
|
|
4
|
|
9
|
use parent "Test::RandomCheck::Types"; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
use Class::Accessor::Lite ( |
6
|
4
|
|
|
|
|
19
|
ro => [qw(min max key_type value_type)], |
7
|
|
|
|
|
|
|
rw => [qw(_list_type)], |
8
|
4
|
|
|
4
|
|
189
|
); |
|
4
|
|
|
|
|
5
|
|
9
|
4
|
|
|
4
|
|
285
|
use Test::RandomCheck::Types::List; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
140
|
|
10
|
4
|
|
|
4
|
|
14
|
use Test::RandomCheck::Types::Reference; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
16
|
|
11
|
4
|
|
|
4
|
|
1291
|
use Test::RandomCheck::Types::Product; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
693
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
5
|
|
|
5
|
|
8
|
my $class = shift; |
15
|
5
|
|
|
|
|
19
|
my $self = $class->SUPER::new(@_); |
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
|
|
38
|
my $kv = Test::RandomCheck::Types::Reference->new( |
18
|
|
|
|
|
|
|
type => product ($self->key_type, $self->value_type) |
19
|
|
|
|
|
|
|
); |
20
|
5
|
|
|
|
|
52
|
my $inner_type = list ($kv, $self->min, $self->max); |
21
|
5
|
|
|
|
|
36
|
$self->_list_type($inner_type); |
22
|
5
|
|
|
|
|
32
|
$self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub arbitrary { |
26
|
406
|
|
|
406
|
|
788
|
my $self = shift; |
27
|
406
|
|
|
1820
|
|
535
|
$self->_list_type->arbitrary->map(sub { +{map { @$_ } @_} }); |
|
1820
|
|
|
|
|
3071
|
|
|
4512
|
|
|
|
|
10456
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub memoize_key { |
31
|
606
|
|
|
606
|
|
1896
|
my ($self, $hash_ref) = @_; |
32
|
|
|
|
|
|
|
$self->_list_type->memoize_key( |
33
|
606
|
|
|
|
|
734
|
map { [$_ => $hash_ref->{$_}] } keys %$hash_ref |
|
1149
|
|
|
|
|
2510
|
|
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |