| 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
| |||||||||||||||||||||||||||||
| 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
Condition33%1/3
$addr eq $exp and not ref $addr
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
| |||||||||||||||||||||||||||||
| 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
Condition33%1/3
$addr eq $exp and not ref $addr
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
| |||||||||||||||||||||||||||||
| 35 | unless $addr eq $exp && ! ref $addr; | ||||||||||||||||||||||||||||
| 36 | 1 | &ok; | |||||||||||||||||||||||||||