line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::RandomCheck::Types; |
2
|
4
|
|
|
4
|
|
1055
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
90
|
|
3
|
4
|
|
|
4
|
|
12
|
use warnings; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
77
|
|
4
|
4
|
|
|
4
|
|
1714
|
use UNIVERSAL::require; |
|
4
|
|
|
|
|
4244
|
|
|
4
|
|
|
|
|
31
|
|
5
|
4
|
|
|
4
|
|
2053
|
use Class::Accessor::Lite (new => 1); |
|
4
|
|
|
|
|
3482
|
|
|
4
|
|
|
|
|
21
|
|
6
|
4
|
|
|
4
|
|
1607
|
use Test::RandomCheck::PRNG; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
34
|
|
7
|
|
|
|
|
|
|
|
8
|
0
|
|
|
0
|
0
|
0
|
sub arbitrary { die "You should implement " . (ref $_[0]) . "::arbitrary" } |
9
|
0
|
|
|
0
|
0
|
0
|
sub memoize_key { die "You should implement " . (ref $_[0]) . "::memoize_key" } |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub sample { |
12
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
13
|
0
|
|
|
|
|
0
|
my $rand = Test::RandomCheck::PRNG->new; |
14
|
0
|
|
|
|
|
0
|
map { [$self->arbitrary->pick($rand, $_)] } 0 .. 19; |
|
0
|
|
|
|
|
0
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub import { |
18
|
16
|
|
|
16
|
|
26
|
my ($class) = @_; |
19
|
16
|
100
|
|
|
|
588
|
return if $class ne __PACKAGE__; # Only export when Types used directly |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# Load all subclasses |
22
|
4
|
|
|
|
|
20
|
(my $relative_path = __PACKAGE__ . '.pm') =~ s!::!/!g; |
23
|
4
|
|
|
|
|
17
|
(my $dir = $INC{$relative_path}) =~ s/\.pm$//; |
24
|
4
|
50
|
|
|
|
205
|
opendir my $h, $dir or die "Can't open $dir: $!"; |
25
|
4
|
|
|
|
|
97
|
while (my $name = readdir $h) { |
26
|
24
|
50
|
|
|
|
431
|
$name =~ /^(.+)\.pm$/ or next; |
27
|
24
|
100
|
|
|
|
194
|
(__PACKAGE__ . "::$1")->require or die $@; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |