1 2#use diagnostics; 3use NetAddr::IP::Lite; 4 5$| = 1; 6 7print "1..2\n"; 8 9my $test = 1; 10sub ok() { 11 print 'ok ',$test++,"\n"; 12} 13 14my $loip = new NetAddr::IP::Lite('1.2.3.4/24'); 15my $hiip = new NetAddr::IP::Lite('FF00::1:4/120'); 16 17## test version lo 18$exp = 4; 19my $version = $loip->version; 20print "got: $version, exp: $exp\nnot " 21 unless $version == $exp; 22&ok; 23 24## test version hi 25$exp = 6; 26$version = $hiip->version; 27print "got: $version, exp: $exp\nnot " 28 unless $version == $exp; 29&ok; 30