Lite/t/loops.t

filter: Statementstmt 89.6% 26 / 29 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 84.6% 33 / 39 CC 1 SCAR 0.0
CC
1
Cov
84%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Lite/t/v4-last.t ↑ Summary Lite/t/nofqdn.t »
1 1 ▶use NetAddr::IP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 1 $| = 1;
4  
5 1 my @deltas = (0, 1, 2, 3, 255);
6  
7 1 print "1..", 15 + @deltas, "\n";
8  
9 1 my $count = 1;
10  
11 1 ▶for (my $ip = new NetAddr::IP::Lite '10.0.0.1/28';
Branch: 1 branch
BranchTrueFalseTotal
if ($ip < $ip->broadcast) 14 1 15
12 $ip < $ip->broadcast;
13 $ip ++)
14 {
15 14 my $o = $ip->addr;
16  
17 14 $o =~ s/^.+\.(\d+)$/$1/;
18  
19 14 ▶ if ($o == $count) {
Branch: 1 branch
BranchTrueFalseTotal
if ($o == $count) { } 14 0 14
20 14 print "ok $count\n";
21 }
22 else {
23 0 print "not ok $count\n";
24 }
25  
26 14 ++ $count;
27 }
28  
29 1 my $ip = new NetAddr::IP::Lite '10.0.0.255/24';
30 1 $ip ++;
31  
32 1 ▶if ($ip eq '10.0.0.0/24') {
Branch: 1 branch
BranchTrueFalseTotal
if ($ip eq '10.0.0.0/24') { } 1 0 1
33 1 print "ok $count\n";
34 }
35 else {
36 0 print "not ok $count\n";
37 }
38  
39 1 ++$count;
40  
41 1 $ip = new NetAddr::IP::Lite '10.0.0.0/24';
42  
43 1 for my $v (@deltas) {
44 5 ▶ if ($ip + $v eq '10.0.0.' . $v . '/24') {
Branch: 1 branch
BranchTrueFalseTotal
if ($ip + $v eq '10.0.0.' . $v . '/24') { } 5 0 5
45 5 print "ok $count\n";
46 }
47 else {
48 0 print "not ok $count\n";
49 }
50 5 ++ $count;
51 }
« Lite/t/v4-last.t ↑ Summary Lite/t/nofqdn.t »