Branch Coverage

blib/lib/Math/Units.pm
Criterion Covered Total %
branch 230 328 70.1


line true false branch
470 41 4 if ref $f ne 'CODE'
481 0 0 if ($u eq '1') { }
0 0 elsif ($dim > 1) { }
0 0 elsif ($dim == 1) { }
0 0 elsif ($dim == -1) { }
0 0 elsif ($dim < -1) { }
488 0 0 if $prefix != 1
493 0 0 unless $num_str
496 0 0 if $den_str
506 36 269 if ($dim > 1)
507 184 121 if ($dim == 1) { }
49 72 elsif ($dim == -1) { }
36 36 elsif ($dim < -1) { }
511 266 39 if ($u ne '1')
512 19 247 if (defined $current_group{$u}) { }
515 2 264 if $current_group{$u} == 0
523 45 285 if (defined $formulas{$u})
528 16 269 if ($apply_reductions and defined $reductions{$u}) { }
236 33 elsif (defined $factor{$u}) { }
538 35 335 if ($u =~ /^$p,?(.+)/)
539 3 32 if (defined $formulas{$1})
544 0 32 if ($apply_reductions and defined $reductions{$1}) { }
30 2 elsif (defined $factor{$1}) { }
564 36 330 if ($u eq '1') { }
578 2 367 unless $u
580 57 310 if ($u =~ s/\^(.+)$//) { }
0 310 elsif ($u =~ /^sq,(.+)/) { }
2 308 elsif ($u =~ /^cu,(.+)/) { }
595 82 285 if $denomenator
597 44 323 if ($u =~ /^-?\d+(?:\.\d+)?(?:e-?\d+)?$/)
598 30 14 if ($dim == 1) { }
13 1 elsif ($dim == -1) { }
604 11 356 if (defined $$u_group{$u}) { }
605 2 9 if ($u eq '1') { }
623 75 150 if ($units =~ m[^([^/]*)/(.*)]) { }
634 225 0 if (scalar @units)
639 75 150 if (scalar @units)
677 44 156 $u1 eq $u2 ? :
687 48 117 if ($u1_dim != $u2_dim)
688 26 22 if $u1_dim != 1
689 27 21 if $u2_dim != 1
693 35 130 if ($u1_dim < 0) { }
701 100 65 if (defined $f)
702 18 82 if (ref $f eq 'CODE') { }
38 44 elsif ($f != 1) { }
707 6 32 if $u1_dim > 1
741 31 4 if (defined $f)
742 6 25 if (ref $f eq 'CODE') { }
25 0 elsif ($f != 1) { }
743 0 6 if ($dim < 0)
751 10 15 if $dim != 1
758 3 11 if ($chained_f_useless) { }
763 11 0 if (exists $factor{$u1} and exists $factor{$tmp_uX})
766 5 6 if $u1_dim != 1
767 3 8 if $tmp_uX_dim != 1
790 188 143 if ($level == 0) { }
791 14 174 if ($dim == $tmp_uX_dim and defined $factor{$u}{$tmp_uX})
798 165 126 unless (defined $tmp_u_history{$child})
804 209 91 if ($attempts < 2)
805 115 94 if ($dim == 1) { }
806 1 114 if ($u =~ /^([^^]+)\^(.+)/)
810 1 0 unless defined $tmp_u_history{$u}
817 94 0 unless defined $tmp_u_history{$u}
846 10 14 if $@ ne "OK\n"
866 100 65 if (defined $new_value)
884 14 10 if (defined $new_value)
893 6 76 if (scalar keys %{$u1_group;} or scalar keys %{$u2_group;})
928 2 264 if $$units =~ s[\bper\b][/]g
0 264 if $$units =~ s/\bsq(uare)?\s+/sq,/g
2 262 if $$units =~ s/\bcu(bic)?\s+/cu,/g
1 261 if $$units =~ s/\s+squared\b/^2/g
0 261 if $$units =~ s/\s+cubed\b/^3/g
5 256 if $$units =~ s/\bmicrons?\b/\265,m/g
0 256 if $$units =~ s/\bdecinano-?/dn,/g
0 256 if $$units =~ s/\btera-?/T,/g
0 256 if $$units =~ s/\bgiga-?/G,/g
0 256 if $$units =~ s/\bmega-?/M,/g
0 256 if $$units =~ s/\bkilo-?/k,/g
0 256 if $$units =~ s/\bhecto-?/h,/g
0 256 if $$units =~ s/\bdeka-?/da,/g
0 256 if $$units =~ s/\bdeca-?/da,/g
0 256 if $$units =~ s/\bdeci-?/d,/g
0 256 if $$units =~ s/\bcenti-?/c,/g
2 254 if $$units =~ s/\bmilli-?/m,/g
0 254 if $$units =~ s/\bmicro-?/\265,/g
0 254 if $$units =~ s/\bnano-?/n,/g
0 254 if $$units =~ s/\bpico-?/p,/g
0 254 if $$units =~ s/\bfemto-?/f,/g
0 254 if $$units =~ s/\bdn-/dn,/g
0 254 if $$units =~ s/\bT-/T,/g
0 254 if $$units =~ s/\bG-/G,/g
0 254 if $$units =~ s/\bM-/M,/g
0 254 if $$units =~ s/\bk-/k,/g
0 254 if $$units =~ s/\bh-/h,/g
0 254 if $$units =~ s/\bda-/da,/g
0 254 if $$units =~ s/\bda-/da,/g
0 254 if $$units =~ s/\bd-/d,/g
0 254 if $$units =~ s/\bc-/c,/g
1 253 if $$units =~ s/\bm-/m,/g
0 253 if $$units =~ s/\b\265-/\265,/g
0 253 if $$units =~ s/\bn-/n,/g
0 253 if $$units =~ s/\bp-/p,/g
0 253 if $$units =~ s/\bf-/f,/g
3 250 if $$units =~ s[\b[Rr][Pp][Mm]\b][cycle/min]g
0 250 if $$units =~ s/\bhz\b/Hz/g
0 250 if $$units =~ s/\b[Cc]elsius\b/C/g
0 250 if $$units =~ s/\b[Ff]arenheit\b/F/g
0 250 if $$units =~ s/\b[Kk]elvins?\b/K/g
0 250 if $$units =~ s/\bdegs?\s+C\b/C/g
0 250 if $$units =~ s/\bdegs?\s+F\b/F/g
0 250 if $$units =~ s/\bC\s+change\b/Cd/g
0 250 if $$units =~ s/\bF\s+change\b/Fd/g
0 250 if $$units =~ s/\bK\s+change\b/Kd/g
0 250 if $$units =~ s/\bdegs\b/deg/g
0 250 if $$units =~ s/\bdegrees?\b/deg/g
0 250 if $$units =~ s/\brads\b/rad/g
0 250 if $$units =~ s/\bradians?\b/rad/g
0 250 if $$units =~ s/\bgrads\b/grad/g
0 250 if $$units =~ s/\bgradians?\b/grad/g
2 248 if $$units =~ s/\bangstroms?\b/dn,m/g
2 246 if $$units =~ s/\bcc\b/cm^3/g
1 245 if $$units =~ s/\bhectares?\b/h,are/g
0 245 if $$units =~ s/\bmils?\b/m,in/g
0 245 if $$units =~ s/amperes?\b/A/g
0 245 if $$units =~ s/amps?\b/A/g
0 245 if $$units =~ s/days\b/day/g
0 245 if $$units =~ s/drams?\b/dr/g
1 244 if $$units =~ s/dynes?\b/dyn/g
1 243 if $$units =~ s/feet\b/ft/g
0 243 if $$units =~ s/foot\b/ft/g
0 243 if $$units =~ s/gallons?\b/gal/g
1 242 if $$units =~ s/gm\b/g/g
2 240 if $$units =~ s/grams?\b/g/g
0 240 if $$units =~ s/grains?\b/gr/g
0 240 if $$units =~ s/hours?\b/hr/g
3 237 if $$units =~ s/inch(es)?\b/in/g
0 237 if $$units =~ s/joules?\b/J/g
0 237 if $$units =~ s/lbs\b/lb/g
0 237 if $$units =~ s/lbm\b/lb/g
0 237 if $$units =~ s/liters?\b/l/g
1 236 if $$units =~ s/meters?\b/m/g
0 236 if $$units =~ s/miles?\b/mi/g
0 236 if $$units =~ s/minutes?\b/min/g
0 236 if $$units =~ s/newtons?\b/N/g
1 235 if $$units =~ s/ounces?\b/oz/g
0 235 if $$units =~ s/pascals?\b/Pa/g
0 235 if $$units =~ s/pints?\b/pt/g
0 235 if $$units =~ s/points?\b/pnt/g
1 234 if $$units =~ s/pounds?\b/lb/g
0 234 if $$units =~ s/quarts?\b/qt/g
2 232 if $$units =~ s/seconds?\b/s/g
7 225 if $$units =~ s/secs?\b/s/g
0 225 if $$units =~ s/watts?\b/W/g
0 225 if $$units =~ s/weeks?\b/wk/g
0 225 if $$units =~ s/yards?\b/yd/g
960 0 213 if $u1 eq $u2
961 137 76 if (defined($f = $conversion_history{$u1}{$u2}))
965 1 75 unless ($factors_computed)
978 6 70 if ($@)
979 6 0 if ($@ eq "REDUCE\n") { }
985 6 0 unless ($combined_f_useless)
993 0 6 if ($@)
994 0 0 if ($@ eq "REDUCE\n") { }
1007 55 21 unless ($combined_f_useless)