Branch Coverage

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


line true false branch
29 112 0 if (exists $DEFAULT_SUFFIXES{$set})
30 112 0 if wantarray
46 148 0 if (exists $ROUND_FUNCTIONS{$style})
106 146 28 unless (defined $seed)
119 65 109 if (@_ == 0) { }
27 82 elsif (@_ == 1 and ref $_[0]) { }
120 0 65 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 69 unless defined $bytes
231 11 58 if $bytes == 0 and defined $options{'ZERO'}
236 4 53 $options{'SI'} ? :
1 57 $options{'SUFFIXES'} ? :
240 3 55 if ($bytes < 0)
248 29 29 if ($bytes >= $block)
254 0 29 if ($magnitude >= 0 + @suffixes)
255 0 0 unless $options{'QUIET'}
263 1 57 if ($x >= $block)
266 0 1 if ($magnitude >= 0 + @suffixes)
267 0 0 unless $options{'QUIET'}
283 33 26 if ($options{'PRECISION_CUTOFF'} != -1 and length sprintf('%d', $bytes) > $options{'PRECISION_CUTOFF'}) { }
296 13 64 if exists $options{'ZERO'} and !(defined $options{'ZERO'} || defined $human) || defined $human && $human eq $options{'ZERO'}
297 3 61 unless defined $human
303 0 61 if ($options{'SUFFIXES'}) { }
311 61 0 if (not defined $options{'SI'} or $options{'SI'} == 1)
329 55 6 unless (defined $options{'SI'})
350 61 685 if ($unit =~ /^$s$u$/i)
351 3 58 $sign eq '-' ? :
357 0 61 unless (defined $mult)