Branch Coverage

blib/lib/POE/Component/Client/DNS.pm
Criterion Covered Total %
branch 73 94 77.6


line true false branch
41 1 7 if @_ % 2
45 2 5 unless $alias
48 2 5 unless $timeout
56 1 6 if scalar keys %params
102 1 12 if @_ % 2
105 1 11 unless exists $args{'event'}
106 1 10 unless exists $args{'context'}
107 1 9 unless exists $args{'host'}
149 16 52 if (ref $event eq 'HASH') { }
4 48 elsif (ref $event eq 'ARRAY') { }
153 13 3 unless $type
156 14 2 unless $class
159 1 15 unless $event
162 1 14 unless $context
166 1 13 if $args{'nameservers'}
169 1 13 unless $host
189 64 1 unless @nameservers
192 59 6 unless $timeout
201 11 54 if ($type eq 'A' || $type eq 'AAAA' and $class eq 'IN')
204 4 7 if (defined $address)
266 0 74 if ($remaining <= 0)
278 0 74 unless $req->{'nameservers'}
288 0 74 unless ($resolver_ref)
289 0 0 if $remaining > 1
296 74 0 if (ref $resolver_ref eq 'IO::Select') { }
325 0 13 unless defined $socket and $event eq $socket
328 0 13 unless $req
335 0 13 if ($remaining <= 0)
369 0 61 unless $req
385 0 61 if (defined $packet and not defined $packet->answerfrom)
387 0 0 if (defined $answerfrom)
438 52 13 if ($api_version < 3) { }
473 4 7 if (defined $self->[4]) { }
478 0 7 if $global_hosts_file and not -f $global_hosts_file
483 2 5 unless ($global_hosts_file)
488 0 2 if ($^O eq 'android')
492 0 2 if ($^O eq 'MSWin32' or $^O eq 'Cygwin')
504 0 2 unless -f $candidate
519 0 11 unless $use_hosts_file
522 1 10 unless -f $use_hosts_file
526 1 6 unless ($self->[5] == ($mtime || -1) and $self->[6] == ($ctime || -1) and $self->[7] == ($inode || -1) and $self->[9] == ($bytes || -1))
532 1 4 unless open HOST, '<', $use_hosts_file
536 0 17 if /^\s*\#/
537 0 17 if /^\s*$/
542 0 17 unless defined $address
544 11 6 $address =~ /:/ ? :
568 6 4 unless exists $self->[8]{$host} and exists $self->[8]{$host}{$type}