Branch Coverage

blib/lib/Net/Routing/Linux.pm
Criterion Covered Total %
branch 30 44 68.1


line true false branch
18 3 1 unless my $self = (shift())->SUPER::new(@_)
22 0 1 unless (defined $self->path)
28 0 1 if (not defined $family) { }
33 0 1 if ($family ne 'inet4' and $family ne 'inet6')
54 4 0 if (-f "$path/netstat")
59 0 4 unless (length $bin)
69 4 0 if ($family eq 'inet4') { }
83 0 4 if ($@) { }
3 1 elsif ($?) { }
98 1 0 if ($family eq 'inet4') { }
127 6 2 if (defined $route and defined $gateway and defined $interface and defined $netmask)
130 0 4 unless ($route =~ /^[0-9\.]+$/ and $gateway =~ /^[0-9\.]+$/ and $netmask =~ /^[0-9\.]+$/)
140 0 4 if ($@)
154 2 2 if ($route eq '0.0.0.0' and $netmask eq '0.0.0.0') { }
164 2 2 if ($gateway eq '0.0.0.0')
170 4 0 unless (exists $cache{$id})
197 7 1 if (defined $route and defined $gateway and defined $interface)
199 1 6 unless ($route =~ m[^[0-9a-f:/]+$]i and $gateway =~ m[^[0-9a-f:/]+$]i)
208 0 6 if ($@)
222 0 6 if ($route eq '::/0' and $interface ne 'lo')
228 6 0 if ($gateway eq '::')
234 5 1 unless (exists $cache{$id})