line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types::Function; |
2
|
4
|
|
|
4
|
|
13
|
use strict; |
|
4
|
|
|
|
|
2
|
|
|
4
|
|
|
|
|
706
|
|
3
|
4
|
|
|
4
|
|
631
|
use warnings; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
84
|
|
4
|
4
|
|
|
4
|
|
636
|
use parent "Test::RandomCheck::Types"; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
12
|
|
5
|
4
|
|
|
4
|
|
178
|
use Class::Accessor::Lite (ro => [qw(dom cod)]); |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
17
|
|
6
|
4
|
|
|
4
|
|
187
|
use Test::RandomCheck::ProbMonad; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
611
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub arbitrary { |
9
|
2828
|
|
|
2828
|
0
|
2496
|
my $self = shift; |
10
|
2828
|
|
|
|
|
3420
|
my $generator = $self->cod->arbitrary; |
11
|
|
|
|
|
|
|
gen { |
12
|
2828
|
|
|
2828
|
|
2069
|
my ($rand, $size) = @_; |
13
|
|
|
|
|
|
|
|
14
|
2828
|
|
|
|
|
1869
|
my %results; |
15
|
|
|
|
|
|
|
sub { |
16
|
7878
|
|
|
|
|
16567
|
my $key = $self->dom->memoize_key(@_); |
17
|
7878
|
|
100
|
|
|
22353
|
$results{$key} //= $generator->pick($rand, $size); |
18
|
2828
|
|
|
|
|
7670
|
}; |
19
|
2828
|
|
|
|
|
6571
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub memoize_key { |
23
|
606
|
|
|
606
|
0
|
1596
|
my ($self, $f) = @_; |
24
|
606
|
|
|
|
|
517
|
int $f; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |