Lite/t/cidr.t

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 3 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 91.1% 31 / 34 CC 1 SCAR 0.0
CC
1
Cov
90%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/bits.t ↑ Summary Lite/t/masklen.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..3\n";
8  
9 1 my $test = 1;
10 3 ▶sub ok() {
Subroutine ok: called CC=1 SCAR=0.0
11 3 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::4/120');
16 1 my $dqip = new NetAddr::IP::Lite('1.2.3.4/24');
17  
18 ## test cidr
19  
20 1 my $exp = 'FF00:0:0:0:0:0:0:4/120';
21 1 my $txt = $hiip->cidr;
22 1 ▶print "got: $txt, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $txt eq $exp 0 1 1
23 unless $txt eq $exp;
24 1 &ok;
25  
26 1 $exp = '0:0:0:0:0:0:102:304/120';
27 1 $txt = $loip->cidr;
28 1 ▶print "got: $txt, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $txt eq $exp 0 1 1
29 unless $txt eq $exp;
30 1 &ok;
31  
32 1 $exp = '1.2.3.4/24';
33 1 $txt = $dqip->cidr;
34 1 ▶print "got: $txt, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $txt eq $exp 0 1 1
35 unless $txt eq $exp;
36 1 &ok;
« Lite/t/bits.t ↑ Summary Lite/t/masklen.t »