Branch Coverage

blib/lib/Net/Cmd.pm
Criterion Covered Total %
branch 63 172 36.6


line true false branch
49 0 0 unless (exists do { *$cmd }->{'net_cmd_asciipeer'})
55 0 0 do { *$cmd }->{'net_cmd_asciipeer'} ? :
63 0 0 do { *$cmd }->{'net_cmd_asciipeer'} ? :
82 0 0 if defined $done{$pkg}
88 0 0 defined ${"${pkg}::VERSION";} ? :
94 0 0 if (@{"${pkg}::ISA";})
103 0 98 unless @_ == 1 or @_ == 2
109 98 0 if (ref $cmd) { }
116 89 9 unless @_ == 2
119 0 9 unless defined $level
123 0 9 if $level and not exists $debug{$pkg}
125 9 0 if (ref $cmd) { }
137 0 16 unless @_ == 1
143 10 6 wantarray ? :
152 0 0 $out ? :
157 0 6 unless @_ == 1
162 0 6 unless exists do { *$cmd }->{'net_cmd_code'}
169 0 0 unless @_ == 1
178 0 21 unless @_ == 3
183 0 21 defined $resp ? :
21 0 unless ref $resp
203 56 0 unless $^O eq "MacOS"
208 56 0 if (defined $nfound and $nfound > 0 or -f $cmd) { }
0 0 elsif ($nfound == -1) { }
211 0 56 unless (defined $w)
221 0 0 if ($! == 4)
222 0 0 if (defined $timeout)
223 0 0 if ($pending = $timeout - (time - $initial)) > 0
248 0 0 if $cmd->debug
257 0 0 if $cmd->debug
263 0 65 unless (defined fileno $cmd)
273 0 19 if $cmd->_is_closed
277 0 19 if exists do { *$cmd }->{'net_cmd_last_ch'}
279 19 0 if (scalar @_)
284 0 26 /\n/ ? :
288 0 19 if $tr
291 0 19 if $cmd->debug
296 0 19 unless $cmd->_syswrite_with_timeout($str)
305 0 0 unless @_ == 1
308 0 0 if 0 < $code
327 2 8 if scalar @{do { *$cmd }->{'net_cmd_lines'};}
329 5 3 defined do { *$cmd }->{'net_cmd_partial'} ? :
332 0 8 if $cmd->_is_closed
345 8 0 if ($select_ret > 0) { }
346 0 8 unless (sysread $cmd, $buf = "", 1024)
370 0 8 if ($tr)
390 0 26 unless $_[1] =~ s/^(\d\d\d)(.?)//o
404 0 26 unless defined $str
407 0 26 if $cmd->debug
411 0 26 unless (defined $code)
412 0 0 if $cmd->debug
422 21 5 unless $more
425 0 21 unless defined $code
436 0 0 unless my $str = $cmd->getline
438 0 0 if $cmd->debug & 4
441 0 0 if $str =~ /^\.\r?\n/o
445 0 0 if (defined $fh) { }
459 0 22 @_ == 1 && ref $_[0] ? :
472 0 22 if $] < "5.010001" and $] != "5.008009"
474 0 22 if $cmd->_is_closed
480 16 6 unless defined $last_ch
482 1 21 unless length $line
484 0 21 if ($cmd->debug)
494 4 17 if ($last_ch eq "\r") { }
16 1 elsif ($last_ch eq "\n") { }
498 4 0 if $line =~ s/^\012(\.?)/$1$1/
502 4 12 if $line =~ /^\./
511 0 21 unless $cmd->_syswrite_with_timeout($line)
520 0 0 @_ == 1 && ref $_[0] ? :
523 0 0 if $cmd->_is_closed
526 0 0 unless length $line
529 0 0 if ($cmd->debug)
534 0 0 unless $cmd->_syswrite_with_timeout($line)
544 0 16 if $cmd->_is_closed
550 0 16 if (not defined $ch) { }
6 10 elsif ($ch ne "\n") { }
559 0 16 if $cmd->debug
562 0 16 unless $cmd->_syswrite_with_timeout($tosend)
591 0 0 unless exists do { *$cmd }->{'net_cmd_readbuf'}
594 0 0 unless do { *$cmd }->{'net_cmd_readbuf'} .= $cmd->getline
595 0 0 if do { *$cmd }->{'net_cmd_readbuf'} =~ s/^\.\r?\n\Z//m
601 0 0 if $done
612 0 0 unless exists do { *$cmd }->{'net_cmd_readbuf'}
614 0 0 if $line =~ /^\.\r?\n/
624 0 0 unless $cmd->datasend(substr($buf, $offset, $len))
632 0 0 exists do { *$cmd }->{'net_cmd_sending'} ? :