line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types::Function; |
2
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
114
|
|
3
|
4
|
|
|
4
|
|
14
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
78
|
|
4
|
4
|
|
|
4
|
|
12
|
use parent "Test::RandomCheck::Types"; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
619
|
|
5
|
4
|
|
|
4
|
|
183
|
use Class::Accessor::Lite (ro => [qw(dom cod)]); |
|
4
|
|
|
|
|
697
|
|
|
4
|
|
|
|
|
753
|
|
6
|
4
|
|
|
4
|
|
233
|
use Test::RandomCheck::ProbMonad; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
688
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub arbitrary { |
9
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
10
|
0
|
|
|
|
|
|
my $generator = $self->cod->arbitrary; |
11
|
|
|
|
|
|
|
gen { |
12
|
0
|
|
|
0
|
|
|
my ($rand, $size) = @_; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my %results; |
15
|
|
|
|
|
|
|
sub { |
16
|
0
|
|
|
|
|
|
my $key = $self->dom->memoize_key(@_); |
17
|
0
|
|
0
|
|
|
|
$results{$key} //= $generator->pick($rand, $size); |
18
|
0
|
|
|
|
|
|
}; |
19
|
0
|
|
|
|
|
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub memoize_key { |
23
|
0
|
|
|
0
|
0
|
|
my ($self, $f) = @_; |
24
|
0
|
|
|
|
|
|
int $f; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |