Branch Coverage

blib/lib/Number/WithError.pm
Criterion Covered Total %
branch 151 196 77.0


line true false branch
242 280 5687 if (ref $proto and not @_)
244 32 248 if ref $num
247 16 1578 ref $_ ? :
42 1214 ref $_ ? :
797 1256 ref $_ eq 'ARRAY' ? :
252 4 5683 unless @_
255 4 5679 unless defined $num
257 2160 3519 unless (@_)
271 16750 17078 if (_ARRAY $err) { }
272 3433 13317 if (@$err == 1) { }
293 0 2160 unless $str =~ /\G\s*($CFloat)/cog
297 36 2172 if ($str =~ m[\G \s* \+ \s* / \s* \- \s* ($CFloat)]cgox) { }
8 2164 elsif ($str =~ / \G \s* \+ \s* ($CFloat) \s* \- \s* ($CFloat)/cgox) { }
4 2160 elsif ($str =~ /\G \s* \- \s* ($CFloat) \s* \+ \s* ($CFloat)/cgox) { }
330 4 86 unless defined $obj
336 16 106 if (_ARRAY0 $e) { }
387 501 0 if (_INSTANCE $_[0], 'Number::WithError') { }
393 0 501 unless defined $obj
434 101 202 unless _INSTANCE $o2, 'Number::WithError'
448 201 102 $l1 > $l2 ? :
456 2040 1886 if (not $ary1 || $ary2) { }
1268 618 elsif ($ary1) { }
460 214 1054 if ($ary2) { }
475 0 303 if (not defined $switch) { }
503 100 200 unless _INSTANCE $o2, 'Number::WithError'
515 100 200 if ($switch)
523 93 207 $l1 > $l2 ? :
531 1939 1760 if (not $ary1 || $ary2) { }
789 971 elsif ($ary1) { }
535 207 582 if ($ary2) { }
550 0 300 if (not defined $switch) { }
579 100 200 unless _INSTANCE $o2, 'Number::WithError'
593 179 121 $l1 > $l2 ? :
601 1850 1777 if (not $ary1 || $ary2) { }
1140 637 elsif ($ary1) { }
605 196 944 if ($ary2) { }
620 0 300 if (not defined $switch) { }
649 100 200 unless _INSTANCE $o2, 'Number::WithError'
659 100 200 if ($switch)
668 78 222 $l1 > $l2 ? :
676 1974 1805 if (not $ary1 || $ary2) { }
723 1082 elsif ($ary1) { }
680 205 518 if ($ary2) { }
695 0 300 if (not defined $switch) { }
729 100 200 unless _INSTANCE $o2, 'Number::WithError'
739 100 200 if ($switch)
744 0 300 if $n1 < 0
750 93 207 $l1 > $l2 ? :
761 989 941 if (not $ary1 || $ary2) { }
394 547 elsif ($ary1) { }
765 110 284 if ($ary2) { }
780 0 300 if (not defined $switch) { }
816 89 111 if $n1 < 0
832 607 437 if (not $ary1) { }
862 97 103 if $n1 < 0
877 651 413 if (not $ary1) { }
921 1136 664 if (not $ary1) { }
965 1212 746 if (not $ary1) { }
1012 634 395 if (not $ary1) { }
1120 0 0 if (ref $err eq 'ARRAY' and @$err == 2) { }
0 0 elsif (ref $err eq 'ARRAY') { }
1201 23071 32148 ref $_ eq 'ARRAY' ? :
1203 0 78290 unless $sci =~ /[eE]([+-]?\d+)$/
1205 11281 67009 if not defined $significant or $exp < $significant
1207 5849 339 defined $significant ? :
1233 4 21 if (ref $err eq 'ARRAY' and @$err == 2) { }
0 21 elsif (ref $err eq 'ARRAY') { }
1311 330 6001 ref $number ? :
1313 306 6025 unless defined $digit
1314 0 6025 if $num =~ /^nan$/i
1322 0 6025 unless $tmp =~ /[eE]([+-]?\d+)$/
1328 5997 28 if ($exp >= 0) { }
8 20 elsif ($exp <= -2) { }
1330 0 5997 unless $res =~ /^([+-]?\d+|[+-]?\d*\.\d+)[eE]([+-]?\d+)$/
1341 0 20 if (not defined $1) { }
19 1 elsif ($1 >= 5) { }
1345 8 11 $num < 0 ? :
1395 0 96 unless _INSTANCE $arg, 'Number::WithError'
1397 0 96 unless defined $arg
1429 0 80 unless _INSTANCE $arg, 'Number::WithError'
1431 0 80 unless defined $arg
1437 0 80 if ($numeq or not defined $numeq)
1444 0 80 $#{$$self{'errors'};} > $#{$$arg{'errors'};} ? :
1449 0 125 if (not defined $e1) { }
0 125 elsif (not defined $e2) { }
1450 0 0 if defined $e2
1451 0 0 unless defined $e2
1458 20 105 if (ref $e1 eq 'ARRAY') { }
0 105 elsif (ref $e2 eq 'ARRAY') { }
1459 0 20 if (not ref $e2 eq 'ARRAY') { }
1461 0 0 if $res
1467 0 40 if $res
1474 0 0 if $res
1479 0 105 if $res
1506 0 16 if ($switch) { }
1507 0 0 unless _INSTANCE $arg, 'Number::WithError'
1520 0 80 if ($switch) { }
1521 0 0 unless _INSTANCE $arg, 'Number::WithError'