Branch Coverage

blib/lib/Socket/More.pm
Criterion Covered Total %
branch 75 116 64.6


line true false branch
30 24 0 unless ($@)
51 10 0 unless ($@)
137 1 11 if (ref $_[1] eq 'HASH') { }
141 0 1 if exists $_[1]{'type'}
158 0 0 if (ref $spec eq 'HASH') { }
0 0 elsif (ref $spec eq 'ARRAY') { }
279 0 0 if ($family == 2) { }
0 0 elsif ($family == 10) { }
0 0 elsif ($family == 1) { }
316 6 9 if exists $spec->{'type'}
344 14 16 unless (ref $_ eq "ARRAY")
350 0 23 unless (&Scalar::Util::looks_like_number($_))
356 3 28 unless (&Scalar::Util::looks_like_number($_))
366 8 7 if (ref $r->{'port'} eq 'ARRAY') { }
374 15 0 if (ref $r->{'path'} eq 'ARRAY') { }
381 0 15 if @{$r->{'port'}} == 0 or @{$r->{'path'}} == 0
396 15 0 if (ref $address ne "ARRAY")
400 15 0 if (ref $group ne "ARRAY")
414 5 10 if (grep /${\"0.0.0.0";}/u, @$address)
430 1 14 if (grep /${\"::";}/u, @$address)
447 6 9 if (@new_address)
456 0 15 if (grep /localhost/u, @$address)
490 1298 484 if $fam != $_->{'family'}
498 18 100 if $fam == 1 and $interface->{'name'} eq "unix" and defined $_->{'path'} and not defined $_->{'port'}
505 96 162 if $fam == 2 || $fam == 10 and defined $_->{'port'} and not defined $_->{'path'} and $_->{'interface'} ne "unix"
520 65 49 if ($fam == 2) { }
31 18 elsif ($fam == 10) { }
18 0 elsif ($fam == 1) { }
521 60 5 if (not exists $_->{'address'} or $_->{'address'} eq '.*') { }
540 0 65 if ($enable_group)
547 30 1 if (not exists $_->{'address'} or $_->{'address'} eq '.*') { }
562 0 31 if ($enable_group)
569 9 9 $_->{'socktype'} == 1 ? :
576 0 18 if $enable_group
585 0 114 unless grep {$clone->{'address'} =~ /$_/iu;} @$address
587 0 114 if ($enable_group)
588 0 0 unless grep {$clone->{'group'} =~ /$_/iu;} @$group
590 0 114 unless defined $clone->{'addr'}
602 11 4 if @output
606 91 12 unless $found
615 0 120 unless $Socket::More::a->{'interface'} cmp $Socket::More::b->{'interface'} or $Socket::More::a->{'family'} cmp $Socket::More::b->{'family'}
636 4 7 unless ($field =~ /=/u)
638 3 1 if (/(.*):(.*)$/u) { }
641 3 0 length $2 ? :
643 0 3 if ($spec{'address'}[0] =~ /localhost/u) { }
2 1 elsif ($spec{'address'}[0] eq '') { }
653 0 1 if ($spec{'address'}[0] =~ s/^\[//u and $spec{'address'}[0] =~ s/\]$//u) { }
682 0 7 if 2 <= grep(/^$key/iu, @full)
690 2 5 if ($key eq 'family') { }
0 5 elsif ($key eq 'socktype') { }
4 1 elsif ($key eq 'type') { }
710 0 7 defined $spec{$key} ? :
773 2 0 if (defined $_->{'port'} and $_->{'port'} == 0)
774 0 2 if ($shared and defined $port) { }
779 0 2 unless CORE::socket my $sock, $_->{'family'}, $_->{'socktype'}, 0
780 0 2 unless setsockopt $sock, 1, 2, 1
781 0 2 unless bind $sock, $_->{'addr'}
788 2 0 if ($ok)