| 1 | |||||||||||
| 2 | #use diagnostics; | ||||||||||
| 3 | 1 | ▶ | use NetAddr::IP::Util qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | inet_n2dx | ||||||||||
| 5 | 1 | ); | |||||||||
| 6 | 1 | ▶ | use NetAddr::IP::Lite; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | $| = 1; | |||||||||
| 9 | |||||||||||
| 10 | 1 | print "1..2\n"; | |||||||||
| 11 | |||||||||||
| 12 | 1 | my $test = 1; | |||||||||
| 13 | 2 | ▶ | sub ok() { | ||||||||
|
Subroutine
ok: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 2 | print 'ok ',$test++,"\n"; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 1 | my $loip = new NetAddr::IP::Lite('::1.2.3.4/120'); # same as 1.2.3.4/24 | |||||||||
| 18 | 1 | my $hiip = new NetAddr::IP::Lite('FF00::4/120'); | |||||||||
| 19 | |||||||||||
| 20 | ## test aton | ||||||||||
| 21 | |||||||||||
| 22 | 1 | my $exp = 'FF00:0:0:0:0:0:0:4'; | |||||||||
| 23 | 1 | my $txt = inet_n2dx($hiip->aton); | |||||||||
| 24 | 1 | ▶ | print "got: $txt, exp: $exp\nnot " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | unless $txt eq $exp; | ||||||||||
| 26 | 1 | &ok; | |||||||||
| 27 | |||||||||||
| 28 | 1 | $exp = '1.2.3.4'; | |||||||||
| 29 | 1 | $txt = inet_n2dx($loip->aton); | |||||||||
| 30 | 1 | ▶ | print "got: $txt, exp: $exp\nnot " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | unless $txt eq $exp; | ||||||||||
| 32 | 1 | &ok; | |||||||||
| 33 | |||||||||||