Branch Coverage

blib/lib/Oktest.pm
Criterion Covered Total %
branch 346 388 89.1


line true false branch
47 142 98 if ($parent) { }
64 349 3 if $to
70 4 68 unless my $to = $Oktest::TopicObject::__current
107 26 1 if ($condition)
156 1 136 unless ($$ao{'_done'})
210 0 142 unless $to->isa('Oktest::TopicObject')
218 0 349 unless $so->isa('Oktest::SpecObject')
230 51 76 if ($$this{'status'} == $EXEC)
232 60 3 if $$so{'status'} == $EXEC
326 0 163 if ($__dumped_with_indent) { }
340 1 164 if (Oktest::Util::is_string($expected))
361 2 109 unless $errmsg =~ /\n$/
371 111 86 if $filename ne '/.cpan/build/Oktest-0.0103-xMdle4/blib/lib/Oktest.pm'
376 111 195 if not $filename or $filename eq '/.cpan/build/Oktest-0.0103-xMdle4/blib/lib/Oktest.pm'
378 195 0 if (-f $filename)
389 165 46 if ($validate)
391 1 164 if $msg
406 161 49 if &$closure($actual, $expected)
463 15 7 if $actual eq $expected
464 3 4 if (not $actual =~ /\n/ || $expected =~ /\n/) { }
474 2 2 unless $actual =~ /\n$/
475 2 2 unless $expected =~ /\n$/
514 1 14 if ($op eq '==') { }
1 13 elsif ($op eq '!=') { }
1 12 elsif ($op eq '<') { }
1 11 elsif ($op eq '<=') { }
1 10 elsif ($op eq '>') { }
1 9 elsif ($op eq '>=') { }
1 8 elsif ($op eq 'eq') { }
1 7 elsif ($op eq 'ne') { }
1 6 elsif ($op eq 'lt') { }
1 5 elsif ($op eq 'le') { }
1 4 elsif ($op eq 'gt') { }
1 3 elsif ($op eq 'ge') { }
1 2 elsif ($op eq '=~') { }
1 1 elsif ($op eq '!~') { }
536 1 3 unless ($min <= $actual)
544 1 2 unless ($actual <= $max)
558 1 7 unless defined $expected
566 1 7 unless defined $expected
578 2 4 unless ($actual->isa($expected))
595 1 2 if ($actual->isa($expected))
608 2 10 unless defined $errmsg
612 3 9 unless ($@)
620 1 8 if (not $errmsg) { }
4 4 elsif (ref $errmsg eq 'Regexp') { }
629 1 3 unless ($ok)
636 3 6 unless ($ok)
652 3 4 if ($@)
670 2 8 unless ($warning)
683 4 4 if (ref $expected eq 'Regexp') { }
685 2 2 unless ($warning =~ /$expected/)
692 1 3 unless ($warning eq $expected)
705 1 2 unless (not $warning)
738 8 5 unless ($bool)
761 6 6 unless ((ref $actual eq $expected) == $bool)
803 1 2 if (Oktest::Util::is_string($actual)) { }
1 1 elsif (ref $actual) { }
804 0 1 unless (CORE::length $actual == $expected)
814 0 1 unless ($n == $expected)
835 1 3 unless (defined $$actual{$name})
841 2 1 if ($#_ == 2)
842 1 1 unless ($$actual{$name} eq $expected)
867 2 6 unless ($method)
872 3 3 unless (!!$actual->can($method) == $bool)
895 2 2 unless ((refaddr $actual == refaddr $expected) == $bool)
908 2 2 unless ($$this{'actual'})
920 1 1 unless (not $$this{'actual'})
933 1 2 unless (defined $actual)
946 1 1 unless (not defined $actual)
960 0 4 unless (ref $actual eq ref $expected)
972 2 2 unless ($actual_dump eq $expected_dump)
989 0 0 if (Dumper($actual) eq Dumper($expected))
1004 0 0 if ($found)
1018 0 0 unless ($found)
1041 0 0 unless ($bool)
1042 0 0 !(-e $actual) ? :
1091 0 0 unless (not -e $actual)
1138 114 105 unless $errmsg
1139 28 77 if $errmsg =~ /^\[Failed\]/
1140 0 77 if $errmsg =~ /^\[ERROR\]/
1141 25 52 if $errmsg =~ /^\[Skipped\]/
1142 25 27 if $errmsg =~ /^\[TODO\]/
1176 36 161 if $$to{'status'} == $IGNORE
1178 5 156 if $$to{'_before_all'}
1180 147 14 if ($$to{'status'} == $EXEC)
1183 219 3 if $$so{'status'} == $EXEC
1192 5 156 if $$to{'_after_all'}
1206 1 218 if ($@) { }
1215 0 218 if $@
1218 1 217 if $@
1236 13 434 if $$to{'_before'}
1245 14 432 if $$to{'_after'}
1254 4 56 if $pat1
1257 6 54 if $pat2
1259 10 50 if ($pat1 or $pat2)
1269 6 56 if ($$so{'desc'} =~ /$pat/) { }
1276 29 5 unless $found
1284 47 7 unless ($$to{'name'} =~ /$pat/)
1296 18 38 if $ret
1298 14 76 if ($$to{'status'} != $IGNORE) { }
14 62 elsif ($flag) { }
1331 0 61 unless $class
1399 8 116 if $status eq 's' and $$this{'report_skipped'}
1400 8 108 if $status eq 't' and $$this{'report_todo'}
1401 60 48 if $status ne 's' and $status ne 't'
1412 26 47 if @exc_items
1422 28 39 if ($status eq 'f') { }
27 12 elsif ($status eq 'E') { }
6 6 elsif ($status eq 's') { }
6 0 elsif ($status eq 't') { }
1455 4 123 $to->isa('Oktest::CaseObject') ? :
1481 48 12 if (not $errmsg) { }
1 11 elsif ($status eq 's') { }
1 10 elsif ($status eq 't') { }
1535 31 22 if ($errmsg)
1536 16 15 if ($status eq 's' or $status eq 't')
1542 19 12 if ($this->_error_should_be_reported($status))
1564 2 30 if $to->isa('Oktest::CaseObject')
1567 11 19 unless $$this{'_nl'}
1569 19 11 if @{$$to{'specs'};}
1575 2 30 if $to->isa('Oktest::CaseObject')
1578 19 11 unless $$this{'_nl'}
1588 31 22 if ($errmsg)
1589 19 12 if ($this->_error_should_be_reported($status))
1620 31 22 if ($errmsg)
1622 19 12 if ($this->_error_should_be_reported($status))
1646 39 0 if @arr
1659 1 8 if &$block($_)
1669 1 8 unless &$block($_)
1677 4 177 if ref $arg
1678 3 174 unless defined $arg
1679 169 5 if ($arg ^ $arg) eq '0'
1685 9 31 if ref $arg
1686 6 25 unless defined $arg
1687 16 9 if ($arg ^ $arg) eq '0'
1693 4 9 is_number($arg) && $arg =~ /^-?\d+$/ ? :
1698 2 11 is_number($arg) && $arg =~ /^-?\d+\.\d+$/ ? :
1703 0 2 unless open my $fh, '<', $filename
1707 0 2 unless close $fh
1714 0 32 unless open my $fh, '>', $filename
1717 0 32 unless close $fh
1726 6 190 if ($filename ne $__read_filename)
1727 0 6 unless open my $fh, '<', $filename
1730 0 6 unless close $fh
1741 2 0 if -e $path
1748 3 2 if (-f $path) { }
2 0 elsif (-d $path) { }
1756 3 4 unless $_ eq '.' or $_ eq '..'
1768 1 2 if $input
1872 2 13 if ($op eq '==') { }
1 12 elsif ($op eq '!=') { }
1 11 elsif ($op eq '>') { }
1 10 elsif ($op eq '>=') { }
1 9 elsif ($op eq '<') { }
1 8 elsif ($op eq '<=') { }
1 7 elsif ($op eq 'eq') { }
1 6 elsif ($op eq 'ne') { }
1 5 elsif ($op eq 'gt') { }
1 4 elsif ($op eq 'ge') { }
1 3 elsif ($op eq 'lt') { }
1 2 elsif ($op eq 'le') { }
1 1 elsif ($op eq '=~') { }
1 0 elsif ($op eq '!~') { }
2033 2 14 unless $desc
2034 2 4 $argname ? :
0 0 $argname ? :
4 4 $argname ? :
8 0 $long ? :
0 8 $short ? :
6 8 $short && $long ? :
2048 2 27 if ($$opts{'help'})
2053 2 25 if ($$opts{'version'})
2058 0 25 unless my $reporter = Oktest::Reporter::create_instance($$opts{'style'})
2060 3 22 if $$opts{'r_skipped'}
2061 3 22 if $$opts{'r_todo'}
2071 1 26 unless -e $arg
2073 5 21 -d $arg ? :
2077 0 47 if $DEBUG
2086 2 48 if ($pattern and $pattern =~ m[^/(.*)/$])
2101 1 49 if $optstr eq '--'
2102 24 25 if ($optstr =~ /^--/) { }
2103 0 24 unless $optstr =~ /^--(\w[-\w]*)(=(.*))?$/
2107 13 11 $has_arg ? :
2108 2 22 unless my $item = $$optdef_dict{$key}
2111 1 21 if $arg_required and not $has_arg
2113 1 20 if not $arg_required and $has_arg
2121 2 28 unless my $item = $$optdef_dict{$ch}
2125 12 16 if (not $argname) { }
13 3 elsif (@optchars) { }
1 2 elsif (@$argv) { }
2139 27 5 if (-f $arg) { }
5 0 elsif (-d $arg) { }
2140 0 27 if $rexp and not $arg =~ /$rexp/