Lite/t/network.t

filter: Statementstmt 100% 29 / 29 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 90.0% 36 / 40 CC 1 SCAR 0.0
CC
1
Cov
89%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/lemasklen.t ↑ Summary Lite/t/v4-basem.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..4\n";
8  
9 1 my $test = 1;
10 4 ▶sub ok() {
Subroutine ok: called CC=1 SCAR=0.0
11 4 print 'ok ',$test++,"\n";
12 }
13  
14 1 my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24
15 1 my $hiip = new NetAddr::IP::Lite('FF00::1:4/120');
16 1 my $dqip = new NetAddr::IP::Lite('1.2.3.4/24');
17  
18 ## test '""' just for the heck of it
19 1 my $exp = 'FF00:0:0:0:0:0:1:4/120';
20 1 my $txt = sprintf("%s",$hiip);
21 1 ▶print 'got: ',$txt," exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $txt eq $exp 0 1 1
22 unless $txt eq $exp;
23 1 &ok;
24  
25 ## test network dq
26 1 $exp = '1.2.3.0/24';
27 1 my $net = $dqip->network;
28 1 ▶print 'got: ',$net, " exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $net eq $exp 0 1 1
29 unless $net eq $exp;
30 1 &ok;
31  
32 ## test network hi
33 1 $exp = 'FF00:0:0:0:0:0:1:0/120';
34 1 $net = $hiip->network;
35 1 ▶print 'got: ',$net, " exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $net eq $exp 0 1 1
36 unless $net eq $exp;
37 1 &ok;
38  
39 ## test network lo
40 1 $exp = '0:0:0:0:0:0:102:300/120';
41 1 $net = $loip->network;
42 1 ▶print 'got: ',$net, " exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $net eq $exp 0 1 1
43 unless $net eq $exp;
44 1 &ok;
« Lite/t/lemasklen.t ↑ Summary Lite/t/v4-basem.t »