Condition Coverage

lib/BATsh/SH.pm
Criterion Covered Total %
condition 327 635 51.5


and 3 conditions

line !l l&&!r l&&r condition
57 15 0 0 $] < "5.006" and not defined &warnings::import
309 382 0 17 $probe =~ /\Atrap(\s.*|)\z/is and not $probe =~ /\Atrap\s*=/
320 268 0 114 $pairs_ref and defined $remainder
268 114 0 $pairs_ref and defined $remainder and $remainder ne ""
347 0 0 382 defined $cmd and $cmd ne ""
545 2 0 0 defined $v && $v ne ''
555 0 0 0 defined $v && $v ne ''
589 0 0 7 defined $v and $v ne ""
603 0 0 0 defined $vv and $vv ne ""
604 0 0 0 defined $vv and $vv ne ""
655 0 0 5 defined $v and $v ne ""
656 0 0 5 defined $v && $v =~ /\A-?\d+\z/
662 0 0 42 defined $v && $v =~ /\A-?\d+\z/
685 4500 0 229 $ch eq "\$" and $i + 1 < $n
4500 215 14 $ch eq "\$" and $i + 1 < $n and $chars[$i + 1] eq "("
692 0 0 386 $i < $n and $depth > 0
699 386 0 0 $c eq "'" and not $in_dq
702 364 0 22 $c eq "\"" and not $in_sq
818 0 2 0 defined $BATsh::SH::_SH_ARRAY_TYPE{$k} and $BATsh::SH::_SH_ARRAY_TYPE{$k} eq "assoc"
923 0 0 2 defined $cmd and $cmd ne ""
1009 14 0 2 not $quoted and $action eq "-"
1010 0 13 1 $quoted and $action eq ""
1060 0 0 2 defined $cmd and $cmd ne ""
1144 0 2 4 defined $v and $v ne ""
1235 0 0 0 _eval_test($1) && _eval_test($2)
1300 0 0 0 length $expr > 0 && $expr ne '0'
1396 6 0 1 not $executed and defined $else_body
1458 3 0 0 $lc_f eq "do" and $depth == 1
1546 2 0 0 $lc_f eq "do" and $depth == 1
1566 0 0 1 defined $in_file and $in_file ne ""
1586 17 5 2 $is_until and $cond_true
1639 1 0 61 not $found and $i <= $#lines
1700 0 17 62 defined $s and $s ne ""
1707 791 0 0 $ch eq "'" and not $dq
1709 37 728 18 not $dq and lc substr($s, $i, 4) eq "esac"
1713 17 2 0 $j >= 0 and $c[$j] eq ' ' || $c[$j] eq "\t"
1716 0 0 18 $aok and $bok
1735 791 0 0 $ch eq "'" and not $dq
1769 88 0 0 $ch eq "'" and not $dq
1772 55 0 24 $ch eq ")" and not $cls
1795 62 0 0 $ch eq "'" and not $dq
1798 49 0 4 $ch eq "|" and not $cls
1829 0 0 0 $i < $n and $c[$i] ne "'"
1834 0 1 1 $i < $n and $c[$i] ne "\""
1835 1 0 0 $c[$i] eq "\\" and $i + 1 < $n
1850 0 3 0 $j < $n and $c[$j] eq '!' || $c[$j] eq '^'
1852 0 3 0 $j < $n and $c[$j] eq "]"
1853 0 3 9 $j < $n and $c[$j] ne "]"
1855 9 0 0 $cc eq "\\" and $j + 1 < $n
1862 0 0 3 $j < $n and $c[$j] eq "]"
1919 4208 0 1 $ch eq "'" and not $in_dq
1922 4050 0 158 $ch eq "\"" and not $in_sq
1940 3407 83 153 $ch =~ /[012]/ and $i + 2 < $n
3490 153 0 $ch =~ /[012]/ and $i + 2 < $n and $chars[$i + 1] eq ">"
236 0 0 $ch =~ /[012]/ and $i + 2 < $n and $chars[$i + 1] eq ">" and $i + 3 < $n ? $chars[$i + 2] eq ">" : 0
0 0 0 $ch =~ /[012]/ and $i + 2 < $n and $chars[$i + 1] eq ">" and $i + 3 < $n ? $chars[$i + 2] eq ">" : 0 and $chars[$i + 3] eq "&"
1948 0 0 0 $j < $n and $chars[$j] =~ /\S/
1952 3407 83 153 $ch =~ /[012]/ and $i + 2 < $n
3490 153 0 $ch =~ /[012]/ and $i + 2 < $n and $chars[$i + 1] eq ">"
236 0 0 $ch =~ /[012]/ and $i + 2 < $n and $chars[$i + 1] eq ">" and $chars[$i + 2] eq "&"
1957 0 0 0 $j < $n and $chars[$j] =~ /\S/
1964 3407 56 180 $ch =~ /[012]/ and $i + 1 < $n
3463 180 0 $ch =~ /[012]/ and $i + 1 < $n and $chars[$i + 1] eq ">"
1970 0 1 1 $j < $n and $chars[$j] eq " "
1972 1 0 18 $j < $n and not $chars[$j] =~ /[\s<>]/
1983 0 0 0 $i + 1 < $n and $chars[$i + 1] eq ">"
1986 0 0 0 $i < $n and $chars[$i] eq " "
1989 0 0 0 $i < $n and not $chars[$i] =~ /[\s<>]/
2033 0 0 12 defined $in_file and $ok
2047 12 0 0 defined $out_file and $ok
12 0 0 $out_to_stderr and $ok
2069 12 0 0 defined $err_file and $ok
12 0 0 $err_to_stdout and $ok
2124 6746 0 15 $ch eq "'" and not $in_dq
2127 6504 0 242 $ch eq "\"" and not $in_sq
2131 826 0 92 $ch eq "\$" and $i + 1 < $n
826 92 0 $ch eq "\$" and $i + 1 < $n and $chars[$i + 1] eq "("
918 0 0 $ch eq ")" and $depth > 0
2137 5398 0 188 $ch eq "\$" and $i + 1 < $n
5398 115 73 $ch eq "\$" and $i + 1 < $n and $chars[$i + 1] eq "("
2140 5366 74 73 $ch eq ")" and $depth > 0
2154 4651 0 3 $ch eq "&" and $i + 1 < $n
4651 0 3 $ch eq "&" and $i + 1 < $n and $chars[$i + 1] eq "&"
2161 4631 0 20 $ch eq "|" and $i + 1 < $n
4631 18 2 $ch eq "|" and $i + 1 < $n and $chars[$i + 1] eq "|"
2204 2 0 1 $LAST_STATUS == 0 and $cmd =~ /\S/
2209 0 0 2 $LAST_STATUS != 0 and $cmd =~ /\S/
2247 6126 0 220 $ch eq "\"" and not $in_sq
2254 760 0 76 $ch eq "\$" and $i + 1 < $n
760 76 0 $ch eq "\$" and $i + 1 < $n and $chars[$i + 1] eq "("
2257 836 0 0 $ch eq ")" and $depth > 0
2276 5096 0 179 $ch eq "\$" and $i + 1 < $n
5096 113 66 $ch eq "\$" and $i + 1 < $n and $chars[$i + 1] eq "("
2286 4974 13 18 $ch eq "|" and $depth == 0
2288 0 18 0 $i + 1 < $n and $chars[$i + 1] eq "|"
2340 17 0 18 defined $input_f and -f $input_f
2406 17 0 0 defined $input_f and -f $input_f
2461 0 0 0 $i < $n and $chars[$i] ne "]"
2540 0 5 1 $depth >= 1 and $line =~ /\{(.*)\}\s*\z/s
2654 84 0 1 $ch eq "'" and not $in_dq
2655 78 0 6 $ch eq "\"" and not $in_sq
2656 75 0 3 $ch =~ /\s/ and not $in_sq
75 2 1 $ch =~ /\s/ and not $in_sq and not $in_dq
2669 4 5 3 not $quoted[$i] and $args[$i] =~ /[*?\[]/
2717 1 7 0 $last >= 1 and $chars[$last - 1] eq "&"
2719 1 7 0 $last >= 1 and $chars[$last - 1] eq ">"
2734 86 0 1 $ch eq "\\" and not $in_sq
2738 86 0 0 $ch eq "'" and not $in_dq
2739 84 0 2 $ch eq "\"" and not $in_sq
2759 0 0 6 defined $w and $w ne ""
2796 0 0 1 $dir eq "" and -d "/tmp"
2799 0 0 1 -d $dir and -w $dir
2833 0 0 0 defined $pid and $pid > 0
2858 0 0 1 defined $pid and $pid ne ""
2866 0 0 1 defined $rc && $rc != -1
2905 0 382 0 $i < $n and $chars[$i] eq ' ' || $chars[$i] eq "\t"
2913 10 346 838 $j < $n and $chars[$j] =~ /[A-Za-z0-9_]/
2915 26 10 346 length $name and $j < $n
36 232 114 length $name and $j < $n and $chars[$j] eq "="
2927 845 0 0 $c eq "'" and not $in_dq
845 0 0 $c eq "'" and not $in_dq and not $in_bt
2928 783 0 62 $c eq "\"" and not $in_bt
2929 194 587 2 not $in_dq and $c eq "`"
2930 204 535 42 not $in_dq || $in_bt and $c eq "\$"
739 0 42 not $in_dq || $in_bt and $c eq "\$" and $j + 1 < $n
535 0 42 not $in_dq || $in_bt and $c eq "\$" and $j + 1 < $n and $chars[$j + 1] eq "("
2933 204 147 388 not $in_dq || $in_bt and $depth > 0
351 346 42 not $in_dq || $in_bt and $depth > 0 and $c eq ")"
2936 204 346 147 not $in_sq || $in_dq || $in_bt and $depth == 0
550 147 0 not $in_sq || $in_dq || $in_bt and $depth == 0 and $c eq ' ' || $c eq "\t"
2948 114 0 0 $k < $n and $chars[$k] eq ' ' || $chars[$k] eq "\t"
2957 0 0 0 $m < $n and $chars[$m] =~ /[A-Za-z0-9_]/
2959 0 0 0 length $nm2 and $m < $n
0 0 0 length $nm2 and $m < $n and $chars[$m] eq "="
3000 9829 0 30 $ch eq "'" and not $in_dq
3001 9559 0 270 $ch eq "\"" and not $in_sq
3005 987 8545 27 not $in_dq and $ch eq "<"
9532 0 27 not $in_dq and $ch eq "<" and $i + 1 < $n
8545 1 26 not $in_dq and $ch eq "<" and $i + 1 < $n and $chars[$i + 1] eq "<"
0 26 0 $i + 2 < $n && $chars[$i + 2] eq '<'
1 0 26 not $in_dq and $ch eq "<" and $i + 1 < $n and $chars[$i + 1] eq "<" and not $i + 2 < $n && $chars[$i + 2] eq '<'
3010 0 24 2 $j < $n and $chars[$j] eq "-"
3011 0 26 0 $j < $n and $chars[$j] eq ' ' || $chars[$j] eq "\t"
3015 0 26 0 $j < $n and $chars[$j] eq q['] || $chars[$j] eq '"'
3020 0 2 6 $j < $n and $chars[$j] ne $q
3024 24 0 72 $j < $n and $chars[$j] =~ /\w/
3045 0 0 12 $dir eq "" and -d "/tmp"
3048 0 0 12 -d $dir and -w $dir
3113 19 3 3 exists $BATsh::SH::_SH_ARRAY_TYPE{$k} && $BATsh::SH::_SH_ARRAY_TYPE{$k} eq 'assoc'
3150 0 14 2 defined $BATsh::SH::_SH_ARRAY_TYPE{$k} and $BATsh::SH::_SH_ARRAY_TYPE{$k} eq "assoc"
3178 0 9 9 defined $BATsh::SH::_SH_ARRAY_TYPE{$k} and $BATsh::SH::_SH_ARRAY_TYPE{$k} eq "assoc"
3203 1912 0 0 $c eq "'" and not $in_dq
3204 1862 0 50 $c eq "\"" and not $in_sq
3226 255 0 0 $c eq "'" and not $in_dq
3227 245 0 10 $c eq "\"" and not $in_sq
3228 32 159 54 not $in_sq || $in_dq and $c =~ /\s/
3255 2 56 0 not $raw_has_quote and $exp =~ /\s/
3303 0 1 3 $ix =~ /\A-?\d+\z/ and $ix + 1 > $next
3307 58 0 2 defined $sub and $sub ne ""
3335 0 2 6 defined $BATsh::SH::_SH_ARRAY_TYPE{$k} && $BATsh::SH::_SH_ARRAY_TYPE{$k} eq 'assoc'
3449 24 0 2 $tok =~ /\A"?\$\{([A-Za-z_][A-Za-z0-9_]*)\[[\@*]\]\}"?\z/ and _arr_exists($1)
3455 23 0 1 $tok =~ /\A"?\$\{!([A-Za-z_][A-Za-z0-9_]*)\[[\@*]\]\}"?\z/ and _arr_exists($1)

or 2 conditions

line l !l condition
900 0 0 $ENV{'HOME'} || 'BATsh::Env'->get('HOME') || '.'
2688 0 0 $rc >> 8 || 1
2795 0 1 $ENV{'TMPDIR'} || $ENV{'TEMP'} || $ENV{'TMP'} || ''
3044 0 12 $ENV{'TMPDIR'} || $ENV{'TEMP'} || $ENV{'TMP'} || ''

or 3 conditions

line l !l&&r !l&&!r condition
165 0 0 478 $_BREAK or $_RETURN
190 4 2 433 $first eq "while" or $first eq "until"
383 0 26 33 $lc_cmd eq "test" or $cmd eq "["
384 0 0 33 $lc_cmd eq "source" or $cmd eq "."
550 0 0 0 not defined $v or $v eq ""
899 0 0 0 $rest eq "" or $rest eq "~"
1037 7 0 10 $sig eq "EXIT" or $sig eq "ERR"
7 0 10 $sig eq "EXIT" or $sig eq "ERR" or $sig eq "DEBUG"
0 0 10 $sig eq "EXIT" or $sig eq "ERR" or $sig eq "DEBUG" or $sig eq "RETURN"
1070 0 0 3 not defined $cmd or $cmd eq ""
1238 0 0 0 _eval_test($1) || _eval_test($2)
1256 1 0 0 !defined($s) || $s == 0
1266 0 0 0 $op eq "=" or $op eq "=="
1456 0 0 6 $lc_f eq "for" or $lc_f eq "while"
0 0 6 $lc_f eq "for" or $lc_f eq "while" or $lc_f eq "until"
1472 0 0 74 $_BREAK or defined $_EXIT_CODE
1544 0 0 4 $lc_f eq "for" or $lc_f eq "while"
0 0 4 $lc_f eq "for" or $lc_f eq "while" or $lc_f eq "until"
1587 5 13 4 $is_until or $cond_true
1684 0 0 21 $_BREAK or $_CONTINUE
0 0 21 $_BREAK or $_CONTINUE or $_RETURN
0 0 21 $_BREAK or $_CONTINUE or $_RETURN or defined $_EXIT_CODE
1711 18 0 0 $i + 4 >= $n || $after =~ /\s/
1713 1 0 1 $c[$j] eq ' ' || $c[$j] eq "\t"
1714 1 0 0 $j < 0 || $c[$j] eq ';' || $c[$j] eq '&' || $c[$j] eq "\n"
1737 0 37 746 $sq or $dq
1771 0 1 85 $sq or $dq
1797 0 1 59 $sq or $dq
1850 1 0 2 $c[$j] eq '!' || $c[$j] eq '^'
1858 0 0 9 $cc eq "\\" or $cc eq "^"
0 0 9 $cc eq "\\" or $cc eq "^" or $cc eq "]"
2664 11 0 0 $cur ne "" or @args
2665 11 0 0 $cur ne "" or @quoted
2742 0 0 8 $in_sq or $in_dq
2765 0 0 4 $w eq "[" or $w eq ":"
0 0 4 $w eq "[" or $w eq ":" or $w eq "."
2905 0 0 382 $chars[$i] eq ' ' || $chars[$i] eq "\t"
2930 194 10 577 $in_dq || $in_bt
2933 194 10 535 $in_dq || $in_bt
2936 194 10 493 $in_sq || $in_dq || $in_bt
0 0 147 $c eq ' ' || $c eq "\t"
2948 0 0 0 $chars[$k] eq ' ' || $chars[$k] eq "\t"
3011 0 0 26 $chars[$j] eq ' ' || $chars[$j] eq "\t"
3015 2 0 24 $chars[$j] eq q['] || $chars[$j] eq '"'
3228 0 32 213 $in_sq || $in_dq
3416 7 0 2 not $is_local or $has_arr_flag
7 0 2 not $is_local or $has_arr_flag or $has_arr_init