File Coverage

blib/lib/CXC/PDL/Bin1D/Utils.pm
Criterion Covered Total %
statement 11 22 50.0
branch n/a
condition n/a
subroutine 4 6 66.6
pod n/a
total 15 28 53.5


line stmt bran cond sub pod time code
1             package CXC::PDL::Bin1D::Utils;
2              
3 5     5   220285 use v5.10;
  5         19  
4 5     5   29 use strict;
  5         8  
  5         164  
5 5     5   40 use warnings;
  5         7  
  5         332  
6              
7 5     5   26 use Exporter 'import';
  5         8  
  5         1234  
8              
9             our $VERSION = '0.28';
10              
11             our @EXPORT_OK = qw[ _bitflags _flags ];
12              
13             sub _bitflags {
14 0     0     my $bit = 1;
15             ## no critic (BuiltinFunctions::ProhibitComplexMappings)
16 0           return shift(), 1, map { $bit <<= 1; $_ => $bit; } @_;
  0            
  0            
17             }
18              
19             sub _flags {
20 0     0     my $bits = shift;
21 0           croak( "unknown flag: $_ " ) for grep { !defined $bits->{$_} } @_;
  0            
22 0           my $mask;
23 0           $mask |= $_ for @{$bits}{@_};
  0            
24 0           return $mask;
25             }
26              
27             1;
28              
29             __END__