Codebase list libnet-ip-xs-perl / 1d7b27f
Merge tag 'upstream/0.17' Upstream version 0.17 Ondřej Surý 7 years ago
7 changed file(s) with 35 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Net-IP-XS
1
2 0.17 22 March 2016
3 - Make IP::Authority an optional dependency, as in Net::IP.
14
25 0.16 9 November 2015
36 - Set array size correctly in NI_ip_is_ipv6 (RT #108605).
33 "Tom Harrison <tomhrr@cpan.org>"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005",
6 "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005",
77 "license" : [
88 "open_source"
99 ],
3232 "runtime" : {
3333 "requires" : {
3434 "IO::Capture::Stderr" : "0",
35 "IP::Authority" : "0",
3635 "Math::BigInt" : "0",
3736 "Test::More" : "0",
3837 "Tie::Simple" : "0"
4544 "url" : "https://github.com/tomhrr/p5-Net-IP-XS"
4645 }
4746 },
48 "version" : "0.16",
49 "x_serialization_backend" : "JSON::PP version 2.27203"
47 "version" : "0.17",
48 "x_serialization_backend" : "JSON::PP version 2.27300"
5049 }
66 configure_requires:
77 ExtUtils::MakeMaker: '0'
88 dynamic_config: 1
9 generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.150005'
9 generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150005'
1010 license: open_source
1111 meta-spec:
1212 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1818 - inc
1919 requires:
2020 IO::Capture::Stderr: '0'
21 IP::Authority: '0'
2221 Math::BigInt: '0'
2322 Test::More: '0'
2423 Tie::Simple: '0'
2524 resources:
2625 repository: https://github.com/tomhrr/p5-Net-IP-XS
27 version: '0.16'
28 x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
26 version: '0.17'
27 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
1919 clean => { FILES => '$(O_FILES)' },
2020 PREREQ_PM => { 'Tie::Simple' => 0,
2121 'Math::BigInt' => 0,
22 'IP::Authority' => 0,
2322 # Test prereqs.
2423 'Test::More' => 0,
2524 'IO::Capture::Stderr' => 0 },
77 use Math::BigInt;
88 use Tie::Simple;
99
10 our $VERSION = '0.16';
10 our $VERSION = '0.17';
1111
1212 our $IP_NO_OVERLAP = 0;
1313 our $IP_PARTIAL_OVERLAP = 1;
22 use warnings;
33 use strict;
44
5 use Test::More tests => 8;
5 use Test::More;
6
7 BEGIN {
8 eval { require IP::Authority; };
9 if (my $error = $@) {
10 plan skip_all => "IP::Authority not available";
11 } else {
12 plan tests => 8;
13 }
14 };
615
716 use Net::IP::XS qw(ip_auth Error Errno);
817
276276 $ip = Net::IP::XS->new('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF');
277277 ok($ip, 'Got new IP object');
278278
279 $ip = Net::IP::XS->new('202/8');
280 is($ip->auth(), 'AP', 'Got correct auth information');
281 is($ip->auth(), 'AP', 'Got correct auth information (cached)');
282
283 $ip = Net::IP::XS->new('2000::');
284 is($ip->auth(), undef, 'Got undef for auth for IPv6 address');
285 is($ip->error(), 'Cannot get auth information: Not an IPv4 address',
286 'Got correct error');
287 is($ip->errno(), 308, 'Got correct errno');
279 eval { require IP::Authority };
280 my $has_ip_authority = (not $@);
281 SKIP: {
282 skip "IP::Authority not available", 5 unless $has_ip_authority;
283
284 $ip = Net::IP::XS->new('202/8');
285 is($ip->auth(), 'AP', 'Got correct auth information');
286 is($ip->auth(), 'AP', 'Got correct auth information (cached)');
287
288 $ip = Net::IP::XS->new('2000::');
289 is($ip->auth(), undef, 'Got undef for auth for IPv6 address');
290 is($ip->error(), 'Cannot get auth information: Not an IPv4 address',
291 'Got correct error');
292 is($ip->errno(), 308, 'Got correct errno');
293 };
288294
289295 $ip->{'ipversion'} = 0;
290296 my @prefixes = $ip->find_prefixes();