Branch Coverage

blib/lib/Net/CIDR.pm
Criterion Covered Total %
branch 101 226 44.6


line true false branch
288 10 22 unless ($cidr =~ m[(.*)/(.*)])
302 0 22 unless $pfix >= 0 and $pfix <= ($#ips + 1) * 8 and $pfix =~ /^[0-9]+$/
315 11 11 if ($isipv6)
337 45 47 unless $ipv6 =~ /:/
339 0 47 unless $ipv6 =~ /^[a-fA-F0-9:\.]+$/
344 0 47 if $ipv6 =~ /^(.*:)([0-9]+\.[0-9\.]+)$/
351 42 5 if ($ipv6 =~ /(.*)::(.*)/) { }
380 0 1441 unless $#octets == 15
385 0 1441 if join(".", splice(@dummy, 0, 12)) eq "0.0.0.0.0.0.0.0.0.0.255.255"
402 3510 1741 unless $words[$i] eq 0
408 391 8067 if $words[$j] ne 0
411 1623 118 if ($j - $i > $indlen)
419 67 1374 if $indlen == 8
421 17 1357 if $ind < 0
445 0 452 unless $_ >= 0 and $_ <= 255 and $_ =~ /^[0-9]+$/
463 21 118 if ($pfix == 0)
474 117 1 if ($pfix >= 8)
511 11 8 if ($isipv6) { }
513 0 11 unless $#ips == 15
518 0 8 unless $#ips == 3
541 1419 264 $isipv6 ? :
552 0 0 if defined $a_isIPv6 and defined $n_isIPv6 and $a_isIPv6 != $n_isIPv6
557 0 0 if $previousNMoctet != 255 and $octet != 0
559 0 0 $octet == 0 ? :
0 0 $octet == 128 ? :
0 0 $octet == 192 ? :
0 0 $octet == 224 ? :
0 0 $octet == 240 ? :
0 0 $octet == 248 ? :
0 0 $octet == 252 ? :
0 0 $octet == 254 ? :
0 0 $octet == 255 ? :
589 0 0 if ($r[$i] =~ m[/])
595 0 0 unless $r[$i] =~ /(.*)-(.*)/
607 0 0 if ($isipv6_1 or $isipv6_2)
609 0 0 unless $isipv6_1 and $isipv6_2
616 0 0 unless $#a == $#b
625 0 0 if $isipv6_1
630 0 0 unless 1 == @r and 1 == @c and not wantarray
644 0 0 if $#a < 0
646 0 0 unless $a >= 0 and $a <= 255 and $a =~ /^[0-9]+$/
647 0 0 unless $b >= 0 and $b <= 255 and $b =~ /^[0-9]+$/ and $b >= $a
651 0 0 if ($a == $b)
670 0 0 unless $_ == 0
671 0 0 unless $_ == 255
673 0 0 unless ($start0)
694 0 0 unless ($end255)
715 0 0 if ($a <= $b)
747 0 0 unless $a >= 0 and $a <= 255 and $a =~ /^[0-9]+$/
748 0 0 unless $b >= 0 and $b <= 255 and $b =~ /^[0-9]+$/ and $b >= $a
761 0 0 if $i >= 8
791 0 3 unless $a >= 0 and $a <= 255 and $a =~ /^[0-9]+$/
792 0 3 unless $b >= 0 and $b <= 8 and $b =~ /^[0-9]+$/
817 14 10 unless $isipv6_1
820 10 14 unless $isipv6_2
823 0 24 unless $#a == $#b
831 0 24 if $#a < 0
875 0 3 unless $cidr =~ m[(.*)/(.*)]
885 0 3 unless $pfix >= 0 and $pfix <= ($#ips + 1) * 8 and $pfix =~ /^[0-9]+$/
892 3 17 if $pfix - $i * 8 < 8
899 1 2 if ($#ips < 0 or $bitsleft == 0)
901 0 1 if ($pfix == 0 and $bitsleft == 0) { }
0 1 elsif ($isipv6) { }
907 0 0 if ($isipv6) { }
936 4 4 if ($isipv6) { }
957 0 4 if ($#{$octets;} % 2 == 0)
973 24 4 if $s ne ""
1003 0 0 unless $ip =~ m[[-/]]
1013 0 0 unless /(.*)-(.*)/
1025 0 0 if _ipcmp($lo, $hi) > 0
1027 0 0 if _ipcmp($b[$i], $lo) < 0
1028 0 0 if _ipcmp($hi, $a[$i]) < 0
1030 0 0 if (_ipcmp($a[$i], $lo) <= 0 and _ipcmp($hi, $b[$i]) <= 0)
1036 0 0 if (_ipcmp($a[$i], $lo) <= 0)
1042 0 0 if (_ipcmp($hi, $b[$i]) <= 0)
1052 0 0 unless (not defined $lo && defined $hi or _ipcmp($lo, $hi) > 0)
1093 0 0 if (_ipcmp(_add1($l), $m) == 0)
1118 0 0 if ++$ip[$i] < 256
1123 0 0 if $i < 0
1126 0 0 if $isipv6
1144 0 0 if --$ip[$i] >= 0
1149 0 0 if $i < 0
1152 0 0 if $isipv6
1171 10 0 unless $ip =~ m[[-/]]
1181 0 30 unless /(.*)-(.*)/
1193 10 7 if _ipcmp($b[$i], $lo) < 0
1194 3 4 if _ipcmp($hi, $a[$i]) < 0
1224 0 11 if $str eq "0:0:0:0:0:0:0:0"
1233 1 63 if ($str =~ /^$zerostr:/) { }
1 62 elsif ($str =~ /:$zerostr:/) { }
0 62 elsif ($str =~ /:$zerostr$/) { }
1258 8 9 if $v =~ m[(.*)/(.*)]
1260 8 9 if (defined $suffix)
1262 0 8 unless $suffix =~ /^\d+$/ and $suffix eq '0' || $suffix =~ /^[123456789]/
1266 3 11 if ($v =~ /^([0-9\.]+)$/ or $v =~ /^::ffff:([0-9\.]+)$/ or $v =~ /^:([0-9\.]+)$/)
1271 0 6 if $n =~ /^\./ or $n =~ /\.$/ or $n =~ /\.\./
1282 0 6 if $#o != 3
1286 0 24 if /^0./
1287 0 24 if $_ < 0 or $_ > 255
1290 3 3 if ($v =~ /^::ffff/) { }
1292 1 2 unless defined $suffix
1294 0 3 if $suffix < 96
1300 1 2 unless defined $suffix
1305 4 82 if $_ eq "$n/$suffix"
1310 0 11 unless $v =~ /^[0-9a-f:]+$/
1312 0 11 if $v =~ /:::/ or $v =~ /^:[^:]/ or $v =~ /[^:]:$/ or $v =~ /::.*::/
1317 0 11 if $#o >= 8 or $#o < 7 and not $v =~ /::/
1321 0 55 if length $_ > 4
1324 7 4 unless defined $suffix
1330 3 8 unless ($compressed[0] =~ /::/)
1336 2 15 if ($split[$i] eq 0)
1352 10 319 if $candidate eq "$c/$suffix"
1362 12 43 if $a eq ""