| 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 | 1 | my $dqip = new NetAddr::IP::Lite('1.2.3.4/24'); | |||||||||
| 17 | |||||||||||
| 18 | ## test bits lo | ||||||||||
| 19 | 1 | $exp = 128; | |||||||||
| 20 | 1 | my $bits = $loip->bits; | |||||||||
| 21 | 1 | ▶ | print "got: $bits, exp: $exp\nnot " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | unless $bits == $exp; | ||||||||||
| 23 | 1 | &ok; | |||||||||
| 24 | |||||||||||
| 25 | ## test bits hi | ||||||||||
| 26 | 1 | $exp = 128; | |||||||||
| 27 | 1 | $bits = $hiip->bits; | |||||||||
| 28 | 1 | ▶ | print "got: $bits, exp: $exp\nnot " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | unless $bits == $exp; | ||||||||||
| 30 | 1 | &ok; | |||||||||
| 31 | |||||||||||
| 32 | ## test dotquad bits | ||||||||||
| 33 | 1 | $exp = 32; | |||||||||
| 34 | 1 | $bits = $dqip->bits; | |||||||||
| 35 | 1 | ▶ | print "got: $bits, exp: $exp\nnot " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | unless $bits == $exp; | ||||||||||
| 37 | 1 | &ok; | |||||||||