Branch Coverage

blib/lib/Test/Inter.pm
Criterion Covered Total %
branch 261 480 54.3


line true false branch
33 10 0 if (@args % 2) { }
78 0 90 unless (exists $o{$opt})
84 0 90 if (exists $opts{'opt'} or exists $ENV{$OPT} or defined ${"main::$OPT";})
89 0 0 if (defined ${"main::$OPT";}) { }
0 0 elsif (exists $ENV{$OPT}) { }
101 0 10 if ($self->{'mode'} ne 'test')
114 10 0 if (-f "$0") { }
0 0 elsif (-d './t') { }
0 0 elsif (-d '../t') { }
121 10 0 if (-d "$moddir/t")
124 10 0 if (-d "$moddir/lib")
139 0 10 if (defined $val)
144 10 0 if ($self->{'use_lib'} eq 'on')
146 0 20 unless defined $dir
154 0 0 if ($req and $req eq 'mod') { }
0 0 elsif ($req and $req eq 'lib') { }
164 0 0 unless defined $val
165 0 0 unless $val =~ /^\d+$/
171 0 0 unless $val
172 0 0 unless $val =~ /^\d+$/
178 0 0 if (not defined $val) { }
182 0 0 unless $val =~ /^\d+$/
190 0 0 if ($self->{'plandone'})
195 0 0 unless defined $val
196 0 0 unless $val =~ /^\d+$/
199 0 0 if ($val != 0)
207 0 8 if ($self->{'plandone'})
212 8 0 unless $val
213 0 8 unless $val =~ /^\d+$/
216 0 8 if ($val != $main::TI_NUM)
223 0 0 unless $val
229 0 0 unless $val
235 0 0 unless $val
241 0 0 unless $val
248 0 2 if (@features)
251 0 0 unless (exists $self->{'features'}{$feature} and $self->{'features'}{$feature})
254 0 0 unless $reason
259 0 0 unless $skip
262 0 2 if ($self->{'plandone'} or $self->{'testsrun'}) { }
264 0 0 unless $reason
268 0 2 unless $reason
288 0 0 if $self->{'quiet'} == 2
294 0 0 if $self->{'quiet'}
306 2 4 unless $mode
307 4 2 unless $mode eq 'feature'
314 2 4 if ($module =~ /^\d+(?:\.\d+)?$/) { }
322 0 4 unless $self->_is_module_name($module)
334 2 4 if $mode eq 'forbid'
335 2 4 if $mode eq 'feature'
345 3 3 if ($eval_result) { }
347 0 3 if ($mode eq 'forbid') { }
1 2 elsif ($mode eq 'feature') { }
351 0 0 unless $self->{'quiet'} == 2
355 1 0 unless ($self->{'quiet'})
365 2 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
369 1 0 unless ($self->{'quiet'})
382 0 6 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
393 7 5 if ($args[$#args] eq 'forbid' or $args[$#args] eq 'feature')
397 10 2 unless $mode eq 'feature'
402 3 9 if (@args == 1 and $args[0] =~ /^\d+(?:\.\d+)?$/) { }
9 0 elsif (@args) { }
414 0 9 unless ($self->_is_module_name($module))
420 3 6 if (@args and $args[0] =~ /^\d+(?:\.\d+)?$/)
424 4 5 @args ? :
442 5 7 if $mode eq 'forbid'
443 2 10 if $mode eq 'feature'
454 6 6 if ($eval_result) { }
456 0 6 if ($mode eq 'forbid') { }
1 5 elsif ($mode eq 'feature') { }
460 0 0 unless $self->{'quiet'} == 2
464 1 0 unless ($self->{'quiet'})
474 5 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
478 1 0 unless ($self->{'quiet'})
491 0 12 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
506 13 0 $module =~ /^[a-zA-Z]\w*$/ ? :
520 0 18 if defined $sigdie
537 0 17 if ($op eq 'skip') { }
17 0 elsif ($op eq 'pass') { }
553 0 17 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
566 0 20 if $skip
570 1 19 if (@args == 0)
581 6 13 if (@args == 1) { }
10 3 elsif (@args == 2) { }
0 3 elsif (@args > 2) { }
613 0 11 if ($op eq 'skip') { }
11 0 elsif ($op eq 'pass') { }
629 0 11 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
642 0 24 if $skip
646 0 24 if (@args < 2)
653 0 24 if (@args == 1) { }
24 0 elsif (@args == 2) { }
674 21 22 if (ref $args->[0] eq 'CODE') { }
7 15 elsif (ref $args->[0] eq 'ARRAY') { }
677 17 4 if (ref $args->[0] eq 'ARRAY')
702 19 24 if ($type eq 'ok') { }
703 13 6 if (ref $result eq 'ARRAY') { }
2 4 elsif (ref $result eq 'HASH') { }
705 18 0 if defined $ele
711 4 0 if defined $val
715 4 0 $result ? :
718 9 10 if (not defined $expected) { }
728 22 2 if ($type eq 'is') { }
735 7 36 if (not $identical and $type ne 'isnt')
736 4 3 if ($func)
740 7 0 unless $type eq 'ok' and not defined $result
744 43 0 $pass ? :
753 18 0 if ($width)
755 0 18 if $width < 10
756 0 18 if length $str > $width
764 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 '') { }
792 0 26 if ($s =~ /\s/) { }
795 0 0 unless ($s =~ /$q/)
798 0 0 unless ($s =~ /$qq/)
812 0 0 unless defined $s1 or defined $s2
813 0 75 unless defined $s1 and defined $s2
814 4 71 if ref $s1 ne ref $s2
816 17 54 if (ref $s1 eq 'ARRAY') { }
4 50 elsif (ref $s1 eq 'HASH') { }
0 50 elsif (ref $s1) { }
817 0 17 if $#$s1 != $#$s2
819 2 33 unless $self->_cmp_structure($s1->[$i], $s2->[$i])
826 0 4 if $#k1 != $#k2
828 0 6 unless exists $s2->{$key}
829 2 4 unless $self->_cmp_structure($s1->{$key}, $s2->{$key})
846 0 44 if ($self->{'skipall'}) { }
0 88 elsif ($main::TI_NUM < $self->{'start'} or $self->{'end'} and $main::TI_NUM > $self->{'end'}) { }
861 0 2 unless $name
863 0 2 if (!ref($func) eq 'CODE')
872 1 1 if ($input)
873 0 1 if (-r $input) { }
1 0 elsif (-r "$testdir/$input") { }
887 2 0 unless ($outputdir)
888 2 0 if (-d $testdir and -w $testdir) { }
895 2 0 if ($outputdir)
896 0 2 unless (-d $outputdir and -w $outputdir)
906 0 2 if (not $expected) { }
0 2 elsif (-r $expected) { }
2 0 elsif (-r "$testdir/$expected") { }
922 0 2 unless (-r "$output")
938 2 0 unless $ENV{'TI_NOCLEAN'}
949 7 0 $name ? :
967 0 4 if (exists $opts{'feature'})
970 0 0 unless exists $self->{'features'}{$feature}
973 0 4 if (exists $opts{'disable'} and not $skip)
976 0 0 if exists $self->{'features'}{$feature}
987 0 4 if (exists $opts{'name'})
991 0 4 if (exists $opts{'skip'})
996 0 4 if (exists $opts{'todo'})
1007 0 4 unless (exists $opts{'tests'})
1014 0 4 if (ref $tests eq 'ARRAY') { }
1020 0 0 if (ref $result eq 'ARRAY') { }
1030 1 3 if $gotexpected
1034 2 2 if (exists $opts{'expected'})
1035 0 2 if ($gotexpected)
1040 1 1 if (ref $expected eq 'ARRAY') { }
1045 1 0 if (ref $exp eq 'ARRAY') { }
1055 0 1 if ($g)
1065 0 3 if ($gotexpected and ($nexp != 1 and $nexp != $ntest))
1072 3 1 if (exists $opts{'func'})
1074 0 3 if (ref $func ne 'CODE')
1086 0 16 if ($skip)
1091 0 16 if ($tests{$t}{'err'})
1101 13 3 if ($gotexpected) { }
1105 13 0 if $func
1108 6 7 $nexp == 1 ? :
1117 0 3 if (@$result == 1)
1128 0 16 if ($op eq 'skip') { }
16 0 elsif ($op eq 'pass') { }
1144 0 16 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
1163 8 2 unless $reason
1165 10 0 if ($self->{'mode'} eq 'test') { }
1169 2 8 unless ($n)
1170 0 2 unless $reason
1179 0 0 if (not $n) { }
1183 0 0 unless $self->{'quiet'}
1191 19 39 unless $name
1197 0 0 if $self->{'mode'} ne 'test' and $self->{'quiet'}
1201 0 58 if ($name =~ /^\d/ and $self->{'quiet'} != 2)
1210 0 0 unless $name
1217 0 0 if ($self->{'abort'} == 2) { }
0 0 elsif ($self->{'abort'}) { }
1226 0 0 unless $name
1232 0 0 if $self->{'mode'} ne 'test' and $self->{'quiet'}
1234 0 0 $name ? :
1300 0 17 unless @$test
1304 5 12 if ($gotboth == -1) { }
0 12 elsif ($gotboth != $both) { }
1313 7 10 if $gotboth
1328 1 33 unless @$list
1338 16 17 if ($line eq '')
1340 0 16 unless $started
1345 0 17 if ($line =~ /^#/)
1354 0 17 unless $started
1368 17 51 unless $self->_test_line($test)
1372 7 44 if ($self->_parse_begin_results($test))
1373 7 0 if ($curr eq 'args') { }
1384 0 44 if $err
1386 29 15 if ($curr eq 'args') { }
1393 7 10 $curr eq 'results' ? :
1410 112 17 if @$test
1421 7 44 if $test->[0] =~ s/^ $sp_opt $results $eot //x
1438 0 61 unless $self->_test_line($test)
1443 0 61 if $err
1444 2 59 if ($found)
1452 0 59 if $err
1453 7 52 if ($found)
1455 0 7 if (@val == 1 and $val[0] eq '')
1462 0 52 if $err
1463 2 50 if ($found)
1465 2 0 if (@val == 1 and $val[0] eq '') { }
1474 0 50 if $err
1475 2 48 if ($found)
1476 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 '') { }
1497 0 48 if $err
1502 0 61 if $err
1503 0 61 unless $found
1506 0 68 if $v eq '__blank__'
1507 0 68 if $v eq '__undef__'
1508 62 6 if $v
1510 61 0 if $found
1546 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) { }
1573 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) { }
1595 0 17 if $e
1603 0 17 if (not $m and $del)
1605 0 0 unless ($self->_test_line($test))
1609 0 0 if ($test->[0] =~ s/^ $sp_opt $newEOT //x) { }
1617 0 17 if ($m eq $close and not @v) { }
1623 11 6 if $m eq $close
1629 2 9 if ($test->[0] eq '')
1633 9 0 if ($test->[0] =~ s/^ $sp_opt $EOT //x) { }