File Coverage

blib/lib/Benchmark/Featureset/ParamCheck/Implementation/ParamsCheck/Perl.pm
Criterion Covered Total %
statement 30 30 100.0
branch 5 6 83.3
condition 2 3 66.6
subroutine 11 11 100.0
pod 0 1 0.0
total 48 51 94.1


line stmt bran cond sub pod time code
1 4     4   12149 use v5.12;
  4         18  
2 4     4   20 use strict;
  4         9  
  4         71  
3 4     4   18 use warnings;
  4         9  
  4         226  
4              
5              
6             our $AUTHORITY = 'cpan:TOBYINK';
7             our $VERSION = '0.006';
8              
9             use parent qw(Benchmark::Featureset::ParamCheck::Base::ParamsCheck);
10 4     4   22 use Scalar::Util qw(blessed);
  4         9  
  4         19  
11 4     4   165 use namespace::autoclean;
  4         9  
  4         206  
12 4     4   22  
  4         9  
  4         17  
13             use constant long_name => 'Params::Check with coderefs';
14 4     4   264 use constant short_name => 'PC-PurePerl';
  4         10  
  4         183  
15 4     4   19  
  4         15  
  4         822  
16             state $check = +{
17             integer => { required => 1, allow => qr/\A-?[0-9]+\z/ },
18             hashes => { required => 1, allow => sub {
19             return unless ref($_[0]) eq 'ARRAY';
20             for my $arr (@{ $_[0] }) {
21 400005 50   400005   16234689 return unless ref($arr) eq 'HASH';
22 400005         576338 }
  400005         773818  
23 2000033 100       3543801 return 1;
24             }},
25 400004         649818 object => { required => 1, allow => sub {
26             blessed($_[0])
27             && $_[0]->can('print')
28 400005 100 66 400005   31340004 && $_[0]->can('close')
29             }},
30             };
31             }
32 48     48 0 175  
33             1;