Oops, it looks like my interpretation of /1 as the problem was wrong. I
wrote some more tests into t/Net-IP-Match-XS.t and several succeed that
should fail.
With the attached test file, I get the following results on MacOSX
10.3.9, Perl 5.8.1:
perl -Mblib t/Net-IP-Match-XS.t
1..8
ok 1 - use Net::IP::Match::XS;
ok 2 - check non-match
ok 3 - check match
ok 4 - check another match
not ok 5 - check another match
# Failed test (t/Net-IP-Match-XS.t at line 33)
not ok 6 - check another match
# Failed test (t/Net-IP-Match-XS.t at line 35)
not ok 7 - check another match
# Failed test (t/Net-IP-Match-XS.t at line 37)
ok 8 - check another match
# Looks like you failed 3 tests of 8.
#!/usr/bin/perl
use strict;
use warnings;
use FindBin qw($Bin);
use Test::More tests => 8;
################# test 1 (should succeed) #######################
BEGIN { use_ok('Net::IP::Match::XS') };
my $match;
################# test 2 (should fail) #######################
$match = match_ip( qw( 207.175.219.202 10.0.0.0/8 99.99.99 ) );
ok( ! $match, "check non-match" );
################# test 3 (should succeed) #######################
$match = match_ip( qw( 207.175.219.202 10.0.0.0/8
192.168.0.0/16 207.175.219.200/29 ) );
ok( $match, "check match" );
################# test 4 (should succeed) #######################
my @ips = split / /, '10.0.0.0/8 192.168.0.0/16 207.175.219.200/29';
$match = match_ip( "'207.175.219.202xxx'", @ips );
ok( $match, "check another match" );
$match = match_ip( qw( 209.249.163.62 209.249.163.0/1) );
ok( !$match, "check another match" );
$match = match_ip( qw( 209.249.163.62 209.249.163.0/2) );
ok( !$match, "check another match" );
$match = match_ip( qw( 209.249.163.62 209.249.163.0/4) );
ok( !$match, "check another match" );
$match = match_ip( qw( 209.249.163.62 209.249.163.0/8) );
ok( $match, "check another match" );