Lite/t/v4-new-first.t

filter: Statementstmt 100% 16 / 16 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 88.4% 23 / 26 CC 1 SCAR 0.0
CC
1
Cov
88%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Lite/t/firstlast.t ↑ Summary Lite/t/v4-old-first.t »
1 1 ▶use NetAddr::IP::Lite;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 1 my $nets = {
4 '10.0.0.16' => [ 24, '10.0.0.1', '10.0.0.254', '10.0.0.11'],
5 '10.0.0.5' => [ 30, '10.0.0.5', '10.0.0.6', 'undef' ],
6 '10.128.0.1' => [ 8, '10.0.0.1', '10.255.255.254', '10.0.0.11'],
7 '10.128.0.1' => [ 24, '10.128.0.1', '10.128.0.254', '10.128.0.11'],
8 };
9  
10 1 $| = 1;
11 1 print "1..", (3 * scalar keys %$nets), "\n";
12  
13 1 my $count = 1;
14  
15 1 for my $a (keys %$nets) {
16 3 my $ip = new NetAddr::IP::Lite $a, $nets->{$a}->[0];
17 3 ▶ print '', (($ip->first->addr ne $nets->{$a}->[1] ?
Branch: 1 branch
BranchTrueFalseTotal
$ip->first->addr ne $nets->{$a}[1] ? : 0 3 3
18 'not ' : ''),
19 "ok ", $count++, "\n");
20 3 ▶ print '', (($ip->last->addr ne $nets->{$a}->[2] ?
Branch: 1 branch
BranchTrueFalseTotal
$ip->last->addr ne $nets->{$a}[2] ? : 0 3 3
21 'not ' : ''),
22 "ok ", $count++, "\n");
23  
24 3 my $new = $ip->nth(10);
25 3 ▶ print '', (((defined $new ? $new->addr : 'undef') ne $nets->{$a}->[3] ?
Branch: 2 branches
BranchTrueFalseTotal
(defined $new ? $new->addr : 'undef') ne $nets->{$a}[3] ? : 0 3 3
defined $new ? : 2 1 3
26 'not ' : ''),
27 "ok ", $count++, "\n");
28 }
29  
30  
« Lite/t/firstlast.t ↑ Summary Lite/t/v4-old-first.t »