Branch Coverage

blib/lib/Test/Inter.pm
Criterion Covered Total %
branch 262 474 55.2


line true false branch
32 1 9 if (@args % 2) { }
77 0 90 unless (exists $o{$opt})
83 0 90 if (exists $opts{'opt'} or exists $ENV{$OPT} or defined ${"main::$OPT";})
88 0 0 if (defined ${"main::$OPT";}) { }
0 0 elsif (exists $ENV{$OPT}) { }
100 0 10 if ($self->{'mode'} ne 'test')
111 10 0 if (-f "$0") { }
0 0 elsif (-d 't') { }
114 0 10 unless $TDIR
122 0 10 if (-d "$TDIR/lib")
125 10 0 if (-d "$TDIR/../lib")
139 0 10 if (defined $val)
144 10 0 if ($self->{'use_lib'} eq 'on')
158 0 0 unless defined $val
159 0 0 unless $val =~ /^\d+$/
165 0 0 unless $val
166 0 0 unless $val =~ /^\d+$/
172 0 0 if (not defined $val) { }
176 0 0 unless $val =~ /^\d+$/
184 0 0 if ($self->{'plandone'})
189 0 0 unless defined $val
190 0 0 unless $val =~ /^\d+$/
193 0 0 if ($val != 0)
201 0 9 if ($self->{'plandone'})
206 9 0 unless $val
207 0 9 unless $val =~ /^\d+$/
210 0 9 if ($val != $main::TI_NUM)
217 0 0 unless $val
223 0 0 unless $val
229 0 0 unless $val
235 0 0 unless $val
242 0 1 if (@features)
245 0 0 unless (exists $self->{'features'}{$feature} and $self->{'features'}{$feature})
248 0 0 unless $reason
253 0 0 unless $skip
256 0 1 if ($self->{'plandone'} or $self->{'testsrun'}) { }
258 0 0 unless $reason
262 0 1 unless $reason
282 0 0 if $self->{'quiet'} == 2
288 0 0 if $self->{'quiet'}
300 2 4 unless $mode
301 4 2 unless $mode eq 'feature'
308 2 4 if ($module =~ /^\d+(?:\.\d+)?$/) { }
316 0 4 unless $self->_is_module_name($module)
326 2 4 if $mode eq 'forbid'
327 2 4 if $mode eq 'feature'
337 3 3 if ($eval_result) { }
339 0 3 if ($mode eq 'forbid') { }
1 2 elsif ($mode eq 'feature') { }
343 0 0 unless $self->{'quiet'} == 2
347 1 0 unless ($self->{'quiet'})
357 2 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
361 1 0 unless ($self->{'quiet'})
374 0 6 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
385 7 5 if ($args[$#args] eq 'forbid' or $args[$#args] eq 'feature')
389 10 2 unless $mode eq 'feature'
394 3 9 if (@args == 1 and $args[0] =~ /^\d+(?:\.\d+)?$/) { }
9 0 elsif (@args) { }
406 0 9 unless ($self->_is_module_name($module))
412 3 6 if (@args and $args[0] =~ /^\d+(?:\.\d+)?$/)
416 4 5 @args ? :
433 5 7 if $mode eq 'forbid'
434 2 10 if $mode eq 'feature'
445 6 6 if ($eval_result) { }
447 0 6 if ($mode eq 'forbid') { }
1 5 elsif ($mode eq 'feature') { }
451 0 0 unless $self->{'quiet'} == 2
455 1 0 unless ($self->{'quiet'})
465 5 1 if ($mode eq 'forbid') { }
1 0 elsif ($mode eq 'feature') { }
469 1 0 unless ($self->{'quiet'})
482 0 12 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
497 13 0 $module =~ /^[a-zA-Z]\w*$/ ? :
511 0 18 if defined $sigdie
528 0 19 if ($op eq 'skip') { }
19 0 elsif ($op eq 'pass') { }
544 0 19 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
557 0 22 if $skip
561 1 21 if (@args == 0)
572 7 14 if (@args == 1) { }
11 3 elsif (@args == 2) { }
0 3 elsif (@args > 2) { }
604 0 11 if ($op eq 'skip') { }
11 0 elsif ($op eq 'pass') { }
620 0 11 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
633 0 24 if $skip
637 0 24 if (@args < 2)
644 0 24 if (@args == 1) { }
24 0 elsif (@args == 2) { }
665 21 24 if (ref $args->[0] eq 'CODE') { }
7 17 elsif (ref $args->[0] eq 'ARRAY') { }
668 17 4 if (ref $args->[0] eq 'ARRAY')
693 21 24 if ($type eq 'ok') { }
694 13 8 if (ref $result eq 'ARRAY') { }
2 6 elsif (ref $result eq 'HASH') { }
696 18 0 if defined $ele
702 4 0 if defined $val
706 6 0 $result ? :
709 10 11 if (not defined $expected) { }
719 22 2 if ($type eq 'is') { }
726 7 38 if (not $identical and $type ne 'isnt')
727 4 3 if ($func)
731 7 0 unless $type eq 'ok' and not defined $result
735 45 0 $pass ? :
744 18 0 if ($width)
746 0 18 if $width < 10
747 0 18 if length $str > $width
755 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 '') { }
783 0 26 if ($s =~ /\s/) { }
786 0 0 unless ($s =~ /$q/)
789 0 0 unless ($s =~ /$qq/)
803 0 0 unless defined $s1 or defined $s2
804 0 78 unless defined $s1 and defined $s2
805 4 74 if ref $s1 ne ref $s2
807 17 57 if (ref $s1 eq 'ARRAY') { }
4 53 elsif (ref $s1 eq 'HASH') { }
0 53 elsif (ref $s1) { }
808 0 17 if $#$s1 != $#$s2
810 2 33 unless $self->_cmp_structure($s1->[$i], $s2->[$i])
817 0 4 if $#k1 != $#k2
819 0 8 unless exists $s2->{$key}
820 2 6 unless $self->_cmp_structure($s1->{$key}, $s2->{$key})
837 0 46 if ($self->{'skipall'}) { }
0 92 elsif ($main::TI_NUM < $self->{'start'} or $self->{'end'} and $main::TI_NUM > $self->{'end'}) { }
852 0 2 unless $name
854 0 2 if (!ref($func) eq 'CODE')
863 1 1 if ($input)
864 0 1 if (-r $input) { }
1 0 elsif (-r "$testdir/$input") { }
878 2 0 unless ($outputdir)
879 2 0 if (-d $testdir and -w $testdir) { }
886 2 0 if ($outputdir)
887 0 2 unless (-d $outputdir and -w $outputdir)
897 0 2 if (not $expected) { }
0 2 elsif (-r $expected) { }
2 0 elsif (-r "$testdir/$expected") { }
913 0 2 unless (-r "$output")
929 2 0 unless $ENV{'TI_NOCLEAN'}
940 7 0 $name ? :
958 0 4 if (exists $opts{'feature'})
961 0 0 unless exists $self->{'features'}{$feature}
964 0 4 if (exists $opts{'disable'} and not $skip)
967 0 0 if exists $self->{'features'}{$feature}
978 0 4 if (exists $opts{'name'})
982 0 4 if (exists $opts{'skip'})
987 0 4 if (exists $opts{'todo'})
998 0 4 unless (exists $opts{'tests'})
1005 0 4 if (ref $tests eq 'ARRAY') { }
1011 0 0 if (ref $result eq 'ARRAY') { }
1021 1 3 if $gotexpected
1025 2 2 if (exists $opts{'expected'})
1026 0 2 if ($gotexpected)
1031 1 1 if (ref $expected eq 'ARRAY') { }
1036 1 0 if (ref $exp eq 'ARRAY') { }
1046 0 1 if ($g)
1056 0 3 if ($gotexpected and ($nexp != 1 and $nexp != $ntest))
1063 3 1 if (exists $opts{'func'})
1065 0 3 if (ref $func ne 'CODE')
1077 0 16 if ($skip)
1082 0 16 if ($tests{$t}{'err'})
1092 13 3 if ($gotexpected) { }
1096 13 0 if $func
1099 6 7 $nexp == 1 ? :
1108 0 3 if (@$result == 1)
1119 0 16 if ($op eq 'skip') { }
16 0 elsif ($op eq 'pass') { }
1135 0 16 if $ok and $self->{'quiet'} or not $ok and $self->{'quiet'} == 2
1154 9 1 unless $reason
1156 10 0 if ($self->{'mode'} eq 'test') { }
1160 1 9 unless ($n)
1161 0 1 unless $reason
1170 0 0 if (not $n) { }
1174 0 0 unless $self->{'quiet'}
1182 19 41 unless $name
1188 0 0 if $self->{'mode'} ne 'test' and $self->{'quiet'}
1192 0 60 if ($name =~ /^\d/ and $self->{'quiet'} != 2)
1201 0 0 unless $name
1208 0 0 if ($self->{'abort'} == 2) { }
0 0 elsif ($self->{'abort'}) { }
1217 0 0 unless $name
1223 0 0 if $self->{'mode'} ne 'test' and $self->{'quiet'}
1225 0 0 $name ? :
1291 0 17 unless @$test
1295 5 12 if ($gotboth == -1) { }
0 12 elsif ($gotboth != $both) { }
1304 7 10 if $gotboth
1319 1 33 unless @$list
1329 16 17 if ($line eq '')
1331 0 16 unless $started
1336 0 17 if ($line =~ /^#/)
1345 0 17 unless $started
1359 17 51 unless $self->_test_line($test)
1363 7 44 if ($self->_parse_begin_results($test))
1364 7 0 if ($curr eq 'args') { }
1375 0 44 if $err
1377 29 15 if ($curr eq 'args') { }
1384 7 10 $curr eq 'results' ? :
1401 112 17 if @$test
1412 7 44 if $test->[0] =~ s/^ $sp_opt $results $eot //x
1429 0 61 unless $self->_test_line($test)
1434 0 61 if $err
1435 2 59 if ($found)
1443 0 59 if $err
1444 7 52 if ($found)
1446 0 7 if (@val == 1 and $val[0] eq '')
1453 0 52 if $err
1454 2 50 if ($found)
1456 2 0 if (@val == 1 and $val[0] eq '') { }
1465 0 50 if $err
1466 2 48 if ($found)
1467 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 '') { }
1488 0 48 if $err
1493 0 61 if $err
1494 0 61 unless $found
1497 0 68 if $v eq '__blank__'
1498 0 68 if $v eq '__undef__'
1499 62 6 if $v
1501 61 0 if $found
1537 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) { }
1564 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) { }
1586 0 17 if $e
1594 0 17 if (not $m and $del)
1596 0 0 unless ($self->_test_line($test))
1600 0 0 if ($test->[0] =~ s/^ $sp_opt $newEOT //x) { }
1608 0 17 if ($m eq $close and not @v) { }
1614 11 6 if $m eq $close
1620 2 9 if ($test->[0] eq '')
1624 9 0 if ($test->[0] =~ s/^ $sp_opt $EOT //x) { }