Branch Coverage

blib/lib/Math/Currency.pm
Criterion Covered Total %
branch 74 90 82.2


line true false branch
71 3 109 if ref $proto
75 0 112 if (eval q['1.01' ne 1.01])
79 4 108 if $value =~ s/(^\()|(\)$)//g
81 21 91 if ((caller)[0] =~ /Math\::BigInt/)
90 82 9 if (not defined $currency and $class->isa('Math::Currency'))
92 20 62 if $class =~ /Math::Currency::(\w+)/
95 29 62 if (defined $currency)
97 20 9 unless (defined $Math::Currency::LC_MONETARY->{$currency})
99 20 0 if $@
104 9 82 if ($format) { }
0 82 elsif ($parent and defined $parent->{'format'}) { }
140 9 28 $neg ? :
143 6 31 $use_int ? :
146 6 31 $use_int ? :
164 8 29 if ($dp < 0) { }
0 29 elsif (length($value) - $dp - 1 < $digits) { }
174 0 37 if (substr($value, -1, 1) eq '.')
188 9 28 $neg ? :
192 8 29 if (substr($value, -1, 1) eq '.')
205 0 322 if $always_init
208 244 78 if (ref $self) { }
209 40 204 if (defined $self->{'format'}) { }
35 169 elsif (defined $key) { }
210 2 38 if (defined $key and $key eq '') { }
220 33 2 if (defined $value or ref $key eq 'HASH')
231 18 60 if (defined $key and not exists $Math::Currency::FORMAT->{$key})
232 10 8 unless (defined $Math::Currency::LC_MONETARY->{$key})
234 7 3 if $@
242 101 203 if (defined $key)
244 29 72 if (ref $key eq 'HASH') { }
250 66 6 unless defined $value
270 20 163 defined $self->{'format'} ? :
275 20 163 if ($myformat)
291 0 4 $str eq '' ? :
305 49 12 @_ == 3 ? :
309 38 84 ref $_ ne $class ? :
330 14 0 unless (utf8::is_utf8($localeconv->{$key}))
336 14 0 unless exists $localeconv->{'currency_symbol'}
370 0 27 if $^O =~ /Win32/
372 2 25 unless (defined $locales)
375 0 2 unless open my $fh, '-|', 'locale -a'
404 0 81 if ($LOCALE eq $currency or ($localeconv->{'int_curr_symbol'} || '') =~ /$currency/)
411 0 0 unless exists $Math::Currency::LC_MONETARY->{$int_curr}
444 0 1 if (@_)
455 0 1 if (@_)