Branch Coverage

lib/Test/Inter.pm
Criterion Covered Total %
branch 277 478 59.6


line true false branch
33 15 1 if (@args % 2) { }
81 2 142 if (defined ${"main::$OPT";}) { }
2 140 elsif (exists $ENV{$OPT}) { }
5 135 elsif (exists $opts{$opt}) { }
95 0 16 if ($self->{'mode'} ne "test")
113 16 0 if (-f "$0") { }
0 0 elsif (-d './t') { }
0 0 elsif (-d '../t') { }
122 16 0 if (-d "$moddir/t")
126 16 0 if (-d "$moddir/lib")
141 0 16 if (defined $val)
146 16 0 if ($self->{'use_lib'} eq "on")
148 0 32 unless defined $dir
156 0 0 if ($req and $req eq 'mod') { }
0 0 elsif ($req and $req eq 'lib') { }
166 0 4 unless defined $val
167 0 4 unless $val =~ /^\d+$/
173 0 4 unless $val
174 0 4 unless $val =~ /^\d+$/
180 0 1 if (not defined $val) { }
184 0 1 unless $val =~ /^\d+$/
192 0 0 if ($self->{'plandone'})
197 0 0 unless defined $val
198 0 0 unless $val =~ /^\d+$/
201 0 0 if ($val != 0)
209 0 14 if ($self->{'plandone'})
214 14 0 unless $val
215 0 14 unless $val =~ /^\d+$/
218 0 14 if ($val != $main::TI_NUM)
225 0 0 unless $val
231 0 0 unless $val
237 0 0 unless $val
243 0 0 unless $val
250 0 2 if (@features)
253 0 0 unless (exists $self->{'features'}{$feature} and $self->{'features'}{$feature})
256 0 0 unless $reason
261 0 0 unless $skip
264 0 2 if ($self->{'plandone'} or $self->{'testsrun'}) { }
266 0 0 unless $reason
270 0 2 unless $reason
290 0 0 if $self->{'quiet'} == 2
296 0 0 if $self->{'quiet'}
308 2 4 unless $mode
309 4 2 unless $mode eq "feature"
317 2 4 if ($module =~ /^\d+(?:\.\d+)?$/) { }
325 0 4 unless $self->_is_module_name($module)
339 2 4 if $mode eq "forbid"
340 2 4 if $mode eq "feature"
350 3 3 if ($eval_result) { }
352 0 3 if ($mode eq 'forbid') { }
1 2 elsif ($mode eq 'feature') { }
356 0 0 unless $self->{'quiet'} == 2
360 1 0 unless ($self->{'quiet'})
370 2 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
374 1 0 unless ($self->{'quiet'})
387 0 6 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
398 7 5 if ($args[$#args] eq "forbid" or $args[$#args] eq "feature")
402 10 2 unless $mode eq "feature"
407 3 9 if (@args == 1 and $args[0] =~ /^\d+(?:\.\d+)?$/) { }
9 0 elsif (@args) { }
419 0 9 unless ($self->_is_module_name($module))
425 3 6 if (@args and $args[0] =~ /^\d+(?:\.\d+)?$/)
429 4 5 @args ? :
449 5 7 if $mode eq "forbid"
450 2 10 if $mode eq "feature"
461 6 6 if ($eval_result) { }
463 0 6 if ($mode eq 'forbid') { }
1 5 elsif ($mode eq 'feature') { }
467 0 0 unless $self->{'quiet'} == 2
471 1 0 unless ($self->{'quiet'})
481 5 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
485 1 0 unless ($self->{'quiet'})
498 0 12 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
513 13 0 $module =~ /^[a-zA-Z]\w*$/ ? :
527 0 18 if defined $sigdie
544 0 17 if ($op eq 'skip') { }
17 0 elsif ($op eq 'pass') { }
560 0 17 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
573 0 20 if $skip
577 1 19 if (@args == 0)
588 6 13 if (@args == 1) { }
10 3 elsif (@args == 2) { }
0 3 elsif (@args > 2) { }
620 21 22 if ($op eq 'skip') { }
22 0 elsif ($op eq 'pass') { }
636 0 43 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
649 21 35 if $skip
653 0 35 if (@args < 2)
660 0 35 if (@args == 1) { }
35 0 elsif (@args == 2) { }
681 21 33 if (ref $args->[0] eq 'CODE') { }
7 26 elsif (ref $args->[0] eq 'ARRAY') { }
684 17 4 if (ref $args->[0] eq "ARRAY")
709 19 35 if ($type eq 'ok') { }
710 13 6 if (ref $result eq 'ARRAY') { }
2 4 elsif (ref $result eq 'HASH') { }
712 18 0 if defined $ele
718 4 0 if defined $val
722 4 0 $result ? :
725 9 10 if (not defined $expected) { }
735 33 2 if ($type eq 'is') { }
742 7 47 if (not $identical and $type ne "isnt")
743 4 3 if ($func)
747 7 0 unless $type eq "ok" and not defined $result
751 54 0 $pass ? :
760 18 0 if ($width)
762 0 18 if $width < 10
763 0 18 if length $str > $width
771 0 38 if (not defined $s) { }
10 28 elsif (ref $s eq 'ARRAY') { }
2 26 elsif (ref $s eq 'HASH') { }
0 26 elsif (ref $s) { }
0 26 elsif ($s eq '') { }
799 0 26 if ($s =~ /\s/) { }
802 0 0 unless ($s =~ /$q/)
805 0 0 unless ($s =~ /$qq/)
819 0 0 unless defined $s1 or defined $s2
820 0 88 unless defined $s1 and defined $s2
821 4 84 if ref $s1 ne ref $s2
823 17 67 if (ref $s1 eq 'ARRAY') { }
4 63 elsif (ref $s1 eq 'HASH') { }
0 63 elsif (ref $s1) { }
824 0 17 if $s1->$#* != $s2->$#*
826 2 33 unless $self->_cmp_structure($s1->[$i], $s2->[$i])
833 0 4 if $#k1 != $#k2
835 0 8 unless exists $s2->{$key}
836 2 6 unless $self->_cmp_structure($s1->{$key}, $s2->{$key})
853 0 76 if ($self->{'skipall'}) { }
21 101 elsif ($main::TI_NUM < $self->{'start'} or $self->{'end'} and $main::TI_NUM > $self->{'end'}) { }
868 0 2 unless $name
870 0 2 unless (ref $func eq "CODE")
879 1 1 if ($input)
880 0 1 if (-r $input) { }
1 0 elsif (-r "$testdir/$input") { }
894 2 0 unless ($outputdir)
895 2 0 if (-d $testdir and -w $testdir) { }
902 2 0 if ($outputdir)
903 0 2 unless (-d $outputdir and -w $outputdir)
913 0 2 if (not $expected) { }
0 2 elsif (-r $expected) { }
2 0 elsif (-r "$testdir/$expected") { }
929 0 2 unless (-r "$output")
945 2 0 unless $ENV{'TI_NOCLEAN'}
956 7 0 $name ? :
974 0 4 if (exists $opts{'feature'})
978 0 0 unless exists $self->{'features'}{$feature} and $self->{'features'}{$feature}
981 0 4 if (exists $opts{'disable'} and not $skip)
985 0 0 if exists $self->{'features'}{$feature} and $self->{'features'}{$feature}
996 0 4 if (exists $opts{'name'})
1000 0 4 if (exists $opts{'skip'})
1005 0 4 if (exists $opts{'todo'})
1016 0 4 unless (exists $opts{'tests'})
1023 0 4 if (ref $tests eq 'ARRAY') { }
1029 0 0 if (ref $result eq 'ARRAY') { }
1039 1 3 if $gotexpected
1043 2 2 if (exists $opts{'expected'})
1044 0 2 if ($gotexpected)
1049 1 1 if (ref $expected eq 'ARRAY') { }
1054 1 0 if (ref $exp eq 'ARRAY') { }
1064 0 1 if ($g)
1074 0 3 if ($gotexpected and ($nexp != 1 and $nexp != $ntest))
1081 3 1 if (exists $opts{'func'})
1083 0 3 if (ref $func ne "CODE")
1095 0 16 if ($skip)
1100 0 16 if ($tests{$t}{'err'})
1110 13 3 if ($gotexpected) { }
1114 13 0 if $func
1117 6 7 $nexp == 1 ? :
1126 0 3 if (@$result == 1)
1137 0 16 if ($op eq 'skip') { }
16 0 elsif ($op eq 'pass') { }
1153 0 16 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
1172 14 2 unless $reason
1174 16 0 if ($self->{'mode'} eq 'test') { }
1178 2 14 unless ($n)
1179 0 2 unless $reason
1188 0 0 if (not $n) { }
1192 0 0 unless $self->{'quiet'}
1200 19 50 unless $name
1206 0 0 if $self->{'mode'} ne "test" and $self->{'quiet'}
1210 0 69 if ($name =~ /^\d/ and $self->{'quiet'} != 2)
1219 0 0 unless $name
1226 0 0 if ($self->{'abort'} == 2) { }
0 0 elsif ($self->{'abort'}) { }
1235 21 0 unless $name
1241 0 0 if $self->{'mode'} ne "test" and $self->{'quiet'}
1243 0 21 $name ? :
1309 0 17 unless @$test
1313 5 12 if ($gotboth == -1) { }
0 12 elsif ($gotboth != $both) { }
1322 7 10 if $gotboth
1337 1 33 unless @$list
1347 16 17 if ($line eq "")
1349 0 16 unless $started
1354 0 17 if ($line =~ /^#/)
1363 0 17 unless $started
1377 17 51 unless $self->_test_line($test)
1381 7 44 if ($self->_parse_begin_results($test))
1382 7 0 if ($curr eq 'args') { }
1393 0 44 if $err
1395 29 15 if ($curr eq 'args') { }
1402 7 10 $curr eq 'results' ? :
1419 112 17 if @$test
1430 7 44 if $test->[0] =~ s/^ $sp_opt $results $eot //x
1447 0 61 unless $self->_test_line($test)
1452 0 61 if $err
1453 2 59 if ($found)
1461 0 59 if $err
1462 7 52 if ($found)
1464 0 7 if (@val == 1 and $val[0] eq "")
1471 0 52 if $err
1472 2 50 if ($found)
1474 2 0 if (@val == 1 and $val[0] eq '') { }
1483 0 50 if $err
1484 2 48 if ($found)
1485 2 0 if (@val == 1 and $val[0] eq '') { }
0 0 elsif (@val % 2 == 0) { }
0 0 elsif (not defined $val[$#val] or $val[$#val] eq '') { }
1506 0 48 if $err
1511 0 61 if $err
1512 0 61 unless $found
1515 0 68 if $v eq "__blank__"
1516 0 68 if $v eq "__undef__"
1517 62 6 if $v
1519 61 0 if $found
1555 2 59 if ($test->[0] =~ s/^ $sp_opt $q ($min_str) $q $EOT//x or $test->[0] =~ s/^ $sp_opt $qq ($min_str) $qq $EOT//x) { }
0 59 elsif ($test->[0] =~ /^ $sp_opt $q/x or $test->[0] =~ /^ $sp_opt $qq/x) { }
1582 2 159 if ($test->[0] =~ s/^ $sp_opt $open ($delim) $sp_opt //x) { }
9 150 elsif ($test->[0] =~ s/^ $sp_opt $open $sp_opt //x) { }
1604 0 17 if $e
1612 0 17 if (not $m and $del)
1614 0 0 unless ($self->_test_line($test))
1618 0 0 if ($test->[0] =~ s/^ $sp_opt $newEOT //x) { }
1626 0 17 if ($m eq $close and not @v) { }
1632 11 6 if $m eq $close
1638 2 9 if ($test->[0] eq "")
1642 9 0 if ($test->[0] =~ s/^ $sp_opt $EOT //x) { }