File Coverage

blib/lib/Benchmark/Featureset/ParamCheck/Implementation/TypeParams/TypeNano.pm
Criterion Covered Total %
statement 28 28 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod 0 2 0.0
total 39 41 95.1


line stmt bran cond sub pod time code
1 4     4   11783 use v5.12;
  4         14  
2 4     4   19 use strict;
  4         6  
  4         69  
3 4     4   17 use warnings;
  4         9  
  4         242  
4              
5              
6             our $AUTHORITY = 'cpan:TOBYINK';
7             our $VERSION = '0.007';
8              
9             use parent qw(Benchmark::Featureset::ParamCheck::Base);
10 4     4   20 use Type::Params 1.016004 qw(compile_named compile);
  4         7  
  4         21  
11 4     4   253 use Type::Nano qw( Int ArrayRef HashRef duck_type );
  4         52  
  4         23  
12 4     4   2611 use namespace::autoclean;
  4         8200  
  4         25  
13 4     4   2048  
  4         10  
  4         30  
14             use constant long_name => 'Type::Params with Type::Nano';
15 4     4   257 use constant short_name => 'TP-Nano';
  4         8  
  4         208  
16 4     4   20  
  4         7  
  4         614  
17             my $ArrayRef_of_HashRef = Type::Nano->new(
18             name => 'ArrayRef[HashRef]',
19             parent => ArrayRef,
20             constraint => sub { HashRef->check($_) || return !!0 for @$_; !!1 },
21             );
22              
23             state $check = compile_named(
24             integer => Int,
25 118     118 0 369 hashes => $ArrayRef_of_HashRef,
26             object => duck_type [qw/ print close /],
27             );
28             }
29              
30             state $check = compile(
31             Int,
32             $ArrayRef_of_HashRef,
33 107     107 0 347 duck_type [qw/ print close /],
34             );
35             }
36              
37             1;