Branch Coverage

blib/lib/Number/Bytes/Human.pm
Criterion Covered Total %
branch 74 92 80.4


line true false branch
29 114 0 if (exists $DEFAULT_SUFFIXES{$set})
30 114 0 if wantarray
46 150 0 if (exists $ROUND_FUNCTIONS{$style})
106 148 28 unless (defined $seed)
119 67 109 if (@_ == 0) { }
27 82 elsif (@_ == 1 and ref $_[0]) { }
120 0 67 defined $seed ? :
128 28 81 unless %options
133 75 34 if ($args{'block'} or $args{'block_size'} or $args{'base'} or $args{'bs'}) { }
3 31 elsif ($args{'block_1024'} or $args{'base_1024'} or $args{'1024'}) { }
3 28 elsif ($args{'block_1000'} or $args{'base_1000'} or $args{'1000'}) { }
142 1 32 unless ($block == 1000 or $block == 1024 or $block == 1024000)
161 4 104 if ($args{'round_function'}) { }
2 102 elsif ($args{'round_style'}) { }
162 2 2 unless (ref $args{'round_function'} eq 'CODE')
173 15 91 if ($args{'si'})
178 4 102 if ($args{'suffixes'})
179 4 0 if (ref $args{'suffixes'} eq 'ARRAY') { }
0 0 elsif ($args{'suffixes'} =~ /^(si_)?(1000|1024)$/) { }
187 6 100 if (defined $args{'unit'})
192 11 95 if (exists $args{'zero'})
194 9 2 if (defined $options{'ZERO'})
200 1 105 if (exists $args{'precision'} and $args{'precision'} =~ /\A\d+\z/)
205 1 0 if (exists $args{'precision_cutoff'} and $args{'precision_cutoff'} =~ /\A\d+\z/ || ($args{'precision_cutoff'} = '-1'))
210 0 106 if ($args{'quiet'})
214 25 81 if (defined $seed)
225 3 70 unless defined $bytes
231 11 59 if $bytes == 0 and defined $options{'ZERO'}
236 4 54 $options{'SI'} ? :
1 58 $options{'SUFFIXES'} ? :
240 3 56 if ($bytes < 0)
248 30 29 if ($bytes >= $block)
254 0 30 if ($magnitude >= 0 + @suffixes)
255 0 0 unless $options{'QUIET'}
263 1 58 if ($x >= $block)
266 0 1 if ($magnitude >= 0 + @suffixes)
267 0 0 unless $options{'QUIET'}
283 33 27 if ($options{'PRECISION_CUTOFF'} != -1 and length sprintf('%d', $bytes) > $options{'PRECISION_CUTOFF'}) { }
296 13 65 if exists $options{'ZERO'} and !(defined $options{'ZERO'} || defined $human) || defined $human && $human eq $options{'ZERO'}
297 3 62 unless defined $human
303 0 62 if ($options{'SUFFIXES'}) { }
311 62 0 if (not defined $options{'SI'} or $options{'SI'} == 1)
329 56 6 unless (defined $options{'SI'})
347 62 659 if ($unit =~ /^$s$u$/i)
348 3 59 $sign eq '-' ? :
353 0 62 unless (defined $mult)