Branch Coverage

blib/lib/Test2/Tools/Command.pm
Criterion Covered Total %
branch 39 40 97.5


line true false branch
23 2 7 if defined $_[0]{'chdir'}
27 7 1 exists $_[0]{'args'} ? :
30 1 7 unless eval { do { local $SIG{'ALRM'} = sub { die "timeout\n"; } ; alarm($_[0]{'timeout'} || $timeout); my $pid = open3(my $in, my $out, my $err = &gensym(), @cmd); if (defined $_[0]{'binmode'}) { foreach my $fh ($in, $out, $err) { binmode $fh, $_[0]{'binmode'}; } ; } ; if (exists $_[0]{'stdin'}) { print $in $_[0]{'stdin'}; close $in; } ; $stdout = do { local $/; readline $out }; $stderr = do { local $/; readline $err }; waitpid $pid, 0; alarm 0; 1 } }
35 1 7 if (defined $_[0]{'binmode'})
38 1 7 if (exists $_[0]{'stdin'})
53 0 7 $? & 128 ? :
62 1 1 $status->{'code'} ? :
2 5 if $_[0]{'munge_status'}
63 1 1 $status->{'signal'} ? :
2 5 if $_[0]{'munge_signal'}
66 3 4 if (exists $_[0]{'status'}) { }
67 1 2 if (not defined $_[0]{'status'}) { }
1 1 elsif (ref $_[0]{'status'} eq '') { }
79 5 2 if ($_[0]{'status'}{'code'} == $status->{'code'} and $_[0]{'status'}{'signal'} == $status->{'signal'} and $_[0]{'status'}{'iscore'} == $status->{'iscore'}) { }
100 2 5 if (defined $_[0]{'stdout'} and ref $_[0]{'stdout'} eq 'Regexp') { }
101 1 1 if ($stdout =~ /$_[0]{'stdout'}/) { }
109 4 1 if ($stdout eq $want) { }
116 2 5 if (defined $_[0]{'stderr'} and ref $_[0]{'stderr'} eq 'Regexp') { }
117 1 1 if ($stderr =~ /$_[0]{'stderr'}/) { }
125 4 1 if ($stderr eq $want) { }