diff --git a/IP.pm b/IP.pm index f7fdc75..640af6d 100644 --- a/IP.pm +++ b/IP.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $Id: IP.pm,v 1.14 2003/10/10 17:51:17 lem Exp $ +# $Id: IP.pm,v 1.15 2003/10/22 23:20:27 lem Exp $ package NetAddr::IP; @@ -48,7 +48,7 @@ our @ISA = qw(Exporter); -our $VERSION = '3.16'; +our $VERSION = '3.17'; ############################################# # These are the overload methods, placed here @@ -532,7 +532,7 @@ vec($addr, 2, 8) = 0; vec($addr, 3, 8) = 0; } - elsif ($ip =~ m/^([xb\d]+)$/) + elsif ($ip =~ m/^(-?[xb\d]+)$/) { my $num = $1; $num += 2 ** 32 if $num < 0; @@ -1493,7 +1493,7 @@ =head1 HISTORY -$Id: IP.pm,v 1.14 2003/10/10 17:51:17 lem Exp $ +$Id: IP.pm,v 1.15 2003/10/22 23:20:27 lem Exp $ =over @@ -2043,6 +2043,11 @@ version. Also, fixed a small pod typo that caused code to show up in the documentation. +=item 3.17 + +Fixed IP.pm so that all test could pass in Solaris machines. Thanks to +all who reported this. + =back =head1 AUTHOR diff --git a/Makefile.PL b/Makefile.PL index 11da492..ea560a0 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,7 +2,7 @@ # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. -# $Id: Makefile.PL,v 1.5 2003/10/09 00:12:22 lem Exp $ +# $Id: Makefile.PL,v 1.7 2003/10/22 23:20:27 lem Exp $ my $checker = 0; diff --git a/t/v4-new.t b/t/v4-new.t index 87e2030..280f3b1 100644 --- a/t/v4-new.t +++ b/t/v4-new.t @@ -1,6 +1,6 @@ use NetAddr::IP; -# $Id: v4-new.t,v 1.7 2003/10/08 06:46:02 lem Exp $ +# $Id: v4-new.t,v 1.8 2003/10/14 18:01:40 lem Exp $ BEGIN { our @a = ( @@ -42,10 +42,15 @@ for my $a (@a) { for my $m (@m) { my $ip = new NetAddr::IP $a->[0], $m->[0]; - is($ip->addr, $a->[1], "$a->[0] / $m->[0] is $a->[1]"); - is($ip->mask, $m->[1], "$a->[0] / $m->[0] is $m->[1]"); - is($ip->bits, 32, "$a->[0] / $m->[0] is 32 bits wide"); - is($ip->version, 4, "$a->[0] / $m->[0] is version 4"); + SKIP: + { + skip "Failed to make an object for $a->[0]/$m->[0]", 4 + unless defined $ip; + is($ip->addr, $a->[1], "$a->[0] / $m->[0] is $a->[1]"); + is($ip->mask, $m->[1], "$a->[0] / $m->[0] is $m->[1]"); + is($ip->bits, 32, "$a->[0] / $m->[0] is 32 bits wide"); + is($ip->version, 4, "$a->[0] / $m->[0] is version 4"); + }; } }