Lite/t/addr.t

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 74.4% 32 / 43 CC 1 SCAR 0.0
CC
1
Cov
81%
BEGIN
1.0
BEGIN
1.0
ok
1.0
CRAP 1.0
« Lite/t/mask.t ↑ Summary Lite/t/new-nth.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::1:4/120');
16  
17 ## test '""' just for the heck of it
18 1 my $exp = 'FF00:0:0:0:0:0:1:4/120';
19 1 my $txt = sprintf("%s",$hiip);
20 1 ▶print 'got: ',$txt," exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $txt eq $exp 0 1 1
21 unless $txt eq $exp;
22 1 &ok;
23  
24 ## test addr lo
25 1 $exp = '0:0:0:0:0:0:102:304';
26 1 my $addr = $loip->addr;
27 1 ▶print "got: $addr, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $addr eq $exp and not ref $addr 0 1 1
Condition33%1/3
$addr eq $exp and not ref $addr
!ll&&!rl&&r
001
MC/DC0%0/2
$addr eq $exp and not ref $addr
$addr eq $exp not ref $addr
Truth table33%1/3
A and not(B)
A= $addr eq $expB= not ref $addr
ABresult
0X0
100
111
28 unless $addr eq $exp && ! ref $addr;
29 1 &ok;
30  
31 ## test addr hi
32 1 $exp = 'FF00:0:0:0:0:0:1:4';
33 1 $addr = $hiip->addr;
34 1 ▶print "got: $addr, exp: $exp\nnot "
Branch: 1 branch
BranchTrueFalseTotal
unless $addr eq $exp and not ref $addr 0 1 1
Condition33%1/3
$addr eq $exp and not ref $addr
!ll&&!rl&&r
001
MC/DC0%0/2
$addr eq $exp and not ref $addr
$addr eq $exp not ref $addr
Truth table33%1/3
A and not(B)
A= $addr eq $expB= not ref $addr
ABresult
0X0
100
111
35 unless $addr eq $exp && ! ref $addr;
36 1 &ok;
« Lite/t/mask.t ↑ Summary Lite/t/new-nth.t »