Branch Coverage

blib/lib/Physics/Unit.pm
Criterion Covered Total %
branch 146 192 76.0


line true false branch
474 0 19 if ref $t or ref $names ne 'ARRAY'
477 0 19 if $Physics::Unit::debug
496 0 60 if not $name && $factor or ref $name or ref $factor
499 0 60 if $Physics::Unit::debug
515 0 440 if (ref $names ne 'ARRAY' or not $def)
520 0 440 if $Physics::Unit::debug
529 0 43 if not $t or ref $t or not $u
539 0 1382 unless $u
540 634 748 if ref $u
542 721 27 if ($unit_by_name{$u})
579 1 1 ref $arg0 eq 'ARRAY' ? :
2 2 !ref($arg0) ? :
582 1 3 if ($argIsUnit)
584 0 8 if (LookName($n) != 2)
587 0 8 if $Physics::Unit::debug
589 5 3 unless ($argIsUnit)
592 5 3 unless ($argIsUnit)
596 1 3 if ($argIsUnit)
605 2 18 if (ref $proto) { }
622 23 26 if ($t = shift())
629 4 22 if $self->{'type'}
635 0 22 if defined $name and defined $prefix{$name}
641 19 648 unless CompareDim($self, $prototype{$_})
645 4 18 unless @t
646 17 1 if @t == 1
659 0 19 unless defined $n
662 19 60 if length $_ < length $n
680 2 9 if $s == 1
684 22 96 if ($d)
686 20 2 if ($s)
688 8 14 unless $d == 1
693 0 11 if $s eq ''
704 3 6 if (@_)
714 0 19 if CompareDim($self, $u)
726 4741 15 defined $u->{'dim'}[$_] ? :
727 4738 18 if (defined $self->{'dim'}[$_]) { }
745 1416 8 if (defined $self->{'dim'}[$_]) { }
766 0 88 unless $p == int $p
771 3 882 unless defined $self->{'dim'}[$_]
786 0 0 if CompareDim($self, $u)
824 2 4 unless ref $obj1
828 0 6 if CompareDim($obj1, $obj2)
829 0 6 unless $obj1->{'factor'} == $obj2->{'factor'}
848 0 1072 if ref $n
849 0 1072 if LookName($n)
867 1 484 if ref $def
882 1 1369 unless defined $d1->[$_]
883 5 1365 unless defined $d2->[$_]
885 648 722 if $c
892 0 1715 if defined $prototype{$name}
893 557 1158 if defined $unit_by_name{$name}
894 20 1138 if defined $reserved_word{$name}
907 0 704 if $self->{'names'}[0]
921 484 2 if (@_)
926 0 486 if $Physics::Unit::debug
931 3 622 if ($tok eq 'times') { }
136 486 elsif ($tok eq 'divide') { }
940 0 486 if $Physics::Unit::debug
949 0 625 if $Physics::Unit::debug
954 0 889 if $Physics::Unit::debug
955 264 625 if ($tok eq 'number' or $tok eq 'name' or $tok eq 'prefix' or $tok eq 'square' or $tok eq 'cubic') { }
964 0 625 if $Physics::Unit::debug
973 0 889 if $Physics::Unit::debug
979 0 966 if $Physics::Unit::debug
980 77 889 if ($tok eq 'exponent') { }
982 0 77 unless $tok eq 'number'
988 0 889 if $Physics::Unit::debug
997 0 963 if $Physics::Unit::debug
1002 338 625 if ($tok eq 'number') { }
64 561 elsif ($tok eq 'prefix') { }
549 12 elsif ($tok eq 'name') { }
2 10 elsif ($tok eq 'lparen') { }
0 10 elsif ($tok eq 'end') { }
8 2 elsif ($tok eq 'square') { }
2 0 elsif ($tok eq 'cubic') { }
1003 0 338 if $Physics::Unit::debug
1010 0 64 if $Physics::Unit::debug
1016 0 549 if $Physics::Unit::debug
1021 0 2 if $Physics::Unit::debug
1024 0 2 unless $tok eq 'rparen'
1029 0 0 if $Physics::Unit::debug
1044 0 963 if $Physics::Unit::debug
1050 1 963 if ($tok eq 'squared') { }
0 963 elsif ($tok eq 'cubed') { }
1067 0 1743 if $Physics::Unit::debug
1072 484 1259 if ($def eq '')
1077 2 1257 if ($def =~ s/^\(//) { }
2 1255 elsif ($def =~ s/^\)//) { }
77 1178 elsif ($def =~ s/^\*\*// or $def =~ s/^\^//) { }
3 1175 elsif ($def =~ s/^\*//) { }
127 1048 elsif ($def =~ s[^/][]) { }
415 633 elsif ($def =~ s/^$Physics::Unit::number_re//io) { }
633 0 elsif ($def =~ m[^([^\ \n\r\t\f\(\)/\^\*]+)]) { }
1100 20 613 if ($l == 1) { }
549 64 elsif ($l == 2) { }
1115 64 875 if ($t =~ /^$p/i)