Merge tag 'upstream/0.17'
Upstream version 0.17
Ondřej Surý
7 years ago
0 | 0 | Revision history for Net-IP-XS |
1 | ||
2 | 0.17 22 March 2016 | |
3 | - Make IP::Authority an optional dependency, as in Net::IP. | |
1 | 4 | |
2 | 5 | 0.16 9 November 2015 |
3 | 6 | - Set array size correctly in NI_ip_is_ipv6 (RT #108605). |
3 | 3 | "Tom Harrison <tomhrr@cpan.org>" |
4 | 4 | ], |
5 | 5 | "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", | |
7 | 7 | "license" : [ |
8 | 8 | "open_source" |
9 | 9 | ], |
32 | 32 | "runtime" : { |
33 | 33 | "requires" : { |
34 | 34 | "IO::Capture::Stderr" : "0", |
35 | "IP::Authority" : "0", | |
36 | 35 | "Math::BigInt" : "0", |
37 | 36 | "Test::More" : "0", |
38 | 37 | "Tie::Simple" : "0" |
45 | 44 | "url" : "https://github.com/tomhrr/p5-Net-IP-XS" |
46 | 45 | } |
47 | 46 | }, |
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" | |
50 | 49 | } |
6 | 6 | configure_requires: |
7 | 7 | ExtUtils::MakeMaker: '0' |
8 | 8 | 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' | |
10 | 10 | license: open_source |
11 | 11 | meta-spec: |
12 | 12 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
18 | 18 | - inc |
19 | 19 | requires: |
20 | 20 | IO::Capture::Stderr: '0' |
21 | IP::Authority: '0' | |
22 | 21 | Math::BigInt: '0' |
23 | 22 | Test::More: '0' |
24 | 23 | Tie::Simple: '0' |
25 | 24 | resources: |
26 | 25 | 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' |
19 | 19 | clean => { FILES => '$(O_FILES)' }, |
20 | 20 | PREREQ_PM => { 'Tie::Simple' => 0, |
21 | 21 | 'Math::BigInt' => 0, |
22 | 'IP::Authority' => 0, | |
23 | 22 | # Test prereqs. |
24 | 23 | 'Test::More' => 0, |
25 | 24 | 'IO::Capture::Stderr' => 0 }, |
7 | 7 | use Math::BigInt; |
8 | 8 | use Tie::Simple; |
9 | 9 | |
10 | our $VERSION = '0.16'; | |
10 | our $VERSION = '0.17'; | |
11 | 11 | |
12 | 12 | our $IP_NO_OVERLAP = 0; |
13 | 13 | our $IP_PARTIAL_OVERLAP = 1; |
2 | 2 | use warnings; |
3 | 3 | use strict; |
4 | 4 | |
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 | }; | |
6 | 15 | |
7 | 16 | use Net::IP::XS qw(ip_auth Error Errno); |
8 | 17 |
276 | 276 | $ip = Net::IP::XS->new('FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF'); |
277 | 277 | ok($ip, 'Got new IP object'); |
278 | 278 | |
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 | }; | |
288 | 294 | |
289 | 295 | $ip->{'ipversion'} = 0; |
290 | 296 | my @prefixes = $ip->find_prefixes(); |