Lite/t/is_local.t

filter: Statementstmt 100% 17 / 17 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 95.8% 23 / 24 CC 1 SCAR 0.0
CC
1
Cov
95%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/v4-wnew.t ↑ Summary Lite/t/rfc_1918.t »
1  
2 #use diagnostics;
3 1 ▶use NetAddr::IP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 $| = 1;
6  
7 1 print "1..9\n";
8  
9 1 my $test = 1;
10 9 ▶sub ok() {
Subroutine ok: called CC=1 SCAR=0.0
11 9 print 'ok ',$test++,"\n";
12 }
13  
14 1 my @ips = qw(
15 126.255.255.255 0
16 127.0.0.0 1
17 127.0.0.1 1
18 127.255.255.254 1
19 127.255.255.255 1
20 128.0.0.0 0
21 ::0 0
22 ::1 1
23 ::2 0
24  
25 );
26  
27  
28 1 ▶for (my $i=0;$i<=$#ips;$i+=2) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#ips) 9 1 10
29 9 my $ip = new NetAddr::IP::Lite($ips[$i]);
30 9 my $got = $ip->is_local();
31 9 my $exp = $ips[$i+1];
32 9 ▶ print $ip," got: $got, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $got == $exp 0 9 9
33 unless $got == $exp;
34 9 &ok;
35 }
36  
« Lite/t/v4-wnew.t ↑ Summary Lite/t/rfc_1918.t »