line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types::Product; |
2
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
80
|
|
3
|
4
|
|
|
4
|
|
11
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
78
|
|
4
|
4
|
|
|
4
|
|
10
|
use parent "Test::RandomCheck::Types"; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
11
|
|
5
|
4
|
|
|
4
|
|
172
|
use Class::Accessor::Lite (ro => [qw(types)]); |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
22
|
|
6
|
4
|
|
|
4
|
|
200
|
use Exporter qw(import); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
84
|
|
7
|
4
|
|
|
4
|
|
12
|
use Test::RandomCheck::Types::AllInteger; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
28
|
|
8
|
4
|
|
|
4
|
|
14
|
use Test::RandomCheck::ProbMonad; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
775
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(product); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub product (@) { |
13
|
21
|
|
|
21
|
0
|
118
|
Test::RandomCheck::Types::Product->new( |
14
|
|
|
|
|
|
|
types => [@_] |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub arbitrary { |
19
|
824
|
|
|
824
|
0
|
1352
|
my $self = shift; |
20
|
|
|
|
|
|
|
gen { |
21
|
7744
|
|
|
7744
|
|
5917
|
my ($rand, $size) = @_; |
22
|
7744
|
|
|
|
|
4692
|
map { $_->arbitrary->pick($rand, $size) } @{$self->types}; |
|
15892
|
|
|
|
|
43690
|
|
|
7744
|
|
|
|
|
10998
|
|
23
|
824
|
|
|
|
|
2141
|
}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub memoize_key { |
27
|
2361
|
|
|
2361
|
0
|
7228
|
my ($self, @xs) = @_; |
28
|
|
|
|
|
|
|
|
29
|
2361
|
|
|
|
|
1427
|
my @keys; |
30
|
2361
|
|
|
|
|
1456
|
for my $i (1 .. $#{$self->types}) { |
|
2361
|
|
|
|
|
2667
|
|
31
|
2967
|
|
|
|
|
8949
|
push @keys, $self->types->[$i]->memoize_key($xs[$i]); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
2361
|
|
|
|
|
5327
|
join '\0', @keys; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |