Branch Coverage

blib/lib/Net/EmptyPort.pm
Criterion Covered Total %
branch 40 48 83.3


line true false branch
25 2 28 $proto eq 'udp' ? :
0 30 $^O eq 'MSWin32' ? :
37 0 1 unless defined $host
44 17 8 @_ && ref $_[0] eq 'HASH' ? :
45 9 16 unless defined $host
47 5 20 $proto ? :
49 4 21 if (defined $port) { }
51 3 1 unless $port =~ /^[0-9]+$/ and $port < 49152
54 0 4 if $proto eq 'tcp' and check_port({'host', $host, 'port', $port})
55 4 0 if can_bind($host, $port, $proto)
62 0 21 if $proto eq 'tcp' and check_port({'host', $host, 'port', $port})
70 88 4 @_ && ref $_[0] eq 'HASH' ? :
71 4 88 unless defined $host
74 2 90 if $proto and lc $proto eq 'udp'
85 14 74 if ($sock) { }
99 0 2 unless my $sock = 'IO::Socket::IP'->new('Proto', 'udp', 'PeerAddr', $host, 'PeerPort', $port, 'V6Only', 1, 'Blocking', 0)
107 0 2 unless $sock->send('0', 0)
132 4 65 if $max_wait >= 0 and $waited > $max_wait
144 15 4 if (@_ and ref $_[0] eq 'HASH') { }
1 3 elsif (@_ == 4) { }
153 4 15 unless defined $host
155 2 17 $proto ? :
159 0 65 $^O eq 'MSWin32' && defined $port ? :
14 50 if ($^O eq 'MSWin32' && defined $port ? `$^X -MTest::TCP::CheckPort -echeck_port $host $port $proto` : check_port({'host', $host, 'port', $port, 'proto', $proto}))