Lite/t/v4-last.t

filter: Statementstmt 88.8% 16 / 18 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 83.3% 20 / 24 CC 1 SCAR 0.0
CC
1
Cov
82%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Lite/t/over_equal.t ↑ Summary Lite/t/loops.t »
1 1 ▶use NetAddr::IP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 1 my %w = ('default' => [ '255.255.255.254', '0.0.0.0' ],
4 'loopback' => [ '127.255.255.254', '255.0.0.0' ],
5 '127.0.0.1/8' => [ '127.255.255.254', '255.0.0.0' ],
6 '10.' => [ '10.255.255.254', '255.0.0.0' ],
7 '10.10.10/24' => [ '10.10.10.254', '255.255.255.0' ],
8 );
9  
10 1 $| = 1;
11  
12 1 print '1..', (2 * scalar keys %w), "\n";
13  
14 1 my $count = 1;
15  
16 1 for my $a (keys %w) {
17 5 my $ip = NetAddr::IP::Lite->new($a)->last;
18  
19 5 ▶ if ($ip->addr eq $w{$a}->[0]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ip->addr eq $w{$a}[0]) { } 5 0 5
20 5 print "ok ", $count++, "\n";
21 }
22 else {
23 0 print "not ok ", $count++, "\n";
24 }
25  
26 5 ▶ if ($ip->mask eq $w{$a}->[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ip->mask eq $w{$a}[1]) { } 5 0 5
27 5 print "ok ", $count++, "\n";
28 }
29 else {
30 0 print "not ok ", $count++, "\n";
31 }
32 }
« Lite/t/over_equal.t ↑ Summary Lite/t/loops.t »