Branch Coverage

blib/lib/Net/PJLink.pm
Criterion Covered Total %
branch 64 104 61.5


line true false branch
331 0 21 unless (defined $args{'host'})
336 21 0 if (&Switch::case(''))
339 0 0 if (&Switch::case('ARRAY')) { }
348 2 19 $args{'try_once'} ? :
349 0 21 if defined $args{'batch'}
351 0 21 $args{'keep_alive'} ? :
352 1 20 if defined $args{'auth_password'}
364 0 170 if ($self->{'host'}{$host})
374 17 153 unless $socket and $socket->connected
389 0 153 unless $self->{'host'}{$host}
393 0 153 unless defined $resp and $resp =~ /^PJLINK ([01])( ([0-9a-fA-F]+))?\x0d$/
395 136 17 if $1 == 0
397 0 17 unless defined $self->{'auth_password'}
399 0 17 unless $3
405 17 0 if defined $resp and $resp =~ /^%1POWR=\d\x0d$/
426 1 36 if (defined $pass and not $pass =~ /^.{1,32}$/) { }
446 0 0 unless defined $self->{'hosts'}{$host}
460 0 0 if $_
470 0 182 unless defined $COMMAND{$cmd}
471 0 182 if $arg =~ /\x0d/
498 170 0 unless ($cnx)
499 17 153 unless ($cnx = $self->_open_connection($host))
501 1 16 if $self->{'try_once'}
504 0 153 unless ($self->_auth_connection($host))
506 0 0 if $self->{'try_once'}
522 0 153 unless defined $status
524 153 0 unless ($self->{'keep_alive'})
529 153 0 if (defined $resp and $resp =~ /^%1$cmd_symbol=(.*)\x0d$/) { }
530 82 71 if (defined $RESPONSE{$1}) { }
541 0 171 if ($self->{'batch'}) { }
561 1 1 if (&Switch::case(''))
564 1 0 if (&Switch::case('ARRAY')) { }
587 1 1 if (&Switch::case(''))
590 1 0 if (&Switch::case('ARRAY')) { }
629 35 15 $_[0] ? :
678 0 14 unless ($value =~ /^[1-9]$/ and $number =~ /^[1-9]$/)
702 1 12 unless /(\d)(\d)/
706 13 0 unless ($self->{'batch'})
720 12 0 $_[0] ? :
733 1 10 $_[0] ? :
749 1 9 unless /([123])([01])/
751 0 9 if (&Switch::case(1))
752 9 0 if (&Switch::case(2))
753 0 0 if (&Switch::case(3))
757 10 0 unless ($self->{'batch'})
807 1 8 unless /(\d)(\d)(\d)(\d)(\d)(\d)/
818 9 0 unless ($self->{'batch'})
843 1 7 unless /((\d+)\s+([10]))+/
853 8 0 unless ($self->{'batch'})
892 1 6 if /^-?\d+$/
893 0 6 unless /[1-5][1-9]( [1-5][1-9])*/
904 7 0 unless ($self->{'batch'})