Branch Coverage

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


line true false branch
71 3 119 if ref $proto
75 0 122 if (eval q['1.01' ne 1.01])
79 4 118 if $value =~ s/(^\()|(\)$)//g
81 21 101 if ((caller)[0] =~ /Math\::BigInt/)
90 92 9 if (not defined $currency and $class->isa('Math::Currency'))
92 12 80 if $class =~ /Math::Currency::(\w+)/
95 21 80 if (defined $currency)
97 12 9 unless (defined $Math::Currency::LC_MONETARY->{$currency})
99 12 0 if $@
104 9 92 if ($format) { }
0 92 elsif ($parent and defined $parent->{'format'}) { }
140 15 42 $neg ? :
143 10 47 $use_int ? :
146 10 47 $use_int ? :
164 12 45 if ($dp < 0) { }
0 45 elsif (length($value) - $dp - 1 < $digits) { }
174 0 57 if (substr($value, -1, 1) eq '.')
188 15 42 $neg ? :
192 12 45 if (substr($value, -1, 1) eq '.')
205 0 364 if $always_init
208 286 78 if (ref $self) { }
209 46 240 if (defined $self->{'format'}) { }
37 203 elsif (defined $key) { }
210 2 44 if (defined $key and $key eq '') { }
220 35 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 103 243 if (defined $key)
244 31 72 if (ref $key eq 'HASH') { }
250 66 6 unless defined $value
270 22 181 defined $self->{'format'} ? :
275 22 181 if ($myformat)
291 0 4 $str eq '' ? :
305 12 49 @_ == 3 ? :
309 44 78 ref $_ ne $class ? :
330 14 0 unless (utf8::is_utf8($localeconv->{$key}))
336 14 0 unless exists $localeconv->{'currency_symbol'}
370 0 19 if $^O =~ /Win32/
372 2 17 unless (defined $locales)
375 0 2 unless open my $fh, '-|', 'locale -a'
404 0 57 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 (@_)