| 1 | use strictscip-perl cpan Geo-IP 1.51 strict/; |
| 2 | use warningsscip-perl cpan Geo-IP 1.51 warnings/; |
| 3 | |
| 4 | use Geo::IPscip-perl cpan Geo-IP 1.51 Geo/IP/; |
| 5 | |
| 6 | use Test::Morescip-perl cpan Geo-IP 1.51 Test/More/; |
| 7 | |
| 8 | if ( Geo::IP->apiscip-perl cpan Geo-IP 1.51 Geo/IP/api(). eq 'PurePerl' and $]scip-perl cpan Geo-IP 1.51 main/`$]`. < 5.014 ) { |
| 9 | planscip-perl cpan Geo-IP 1.51 main/plan(). skip_all => 'perl provides ipv6 functions from version 5.14'; |
| 10 | } |
| 11 | |
| 12 | my $gi = Geo::IP->openscip-perl cpan Geo-IP 1.51 Geo/IP/open().( 't/data/GeoIPv6.dat', GEOIP_STANDARD ); |
| 13 | |
| 14 | isscip-perl cpan Geo-IP 1.51 main/is().( |
| 15 | $gi->country_code_by_addr_v6scip-perl cpan Geo-IP 1.51 Geo/IP/country_code_by_addr_v6().('2001:200::'), 'JP', |
| 16 | 'expected country code' |
| 17 | ); |
| 18 | |
| 19 | done_testingscip-perl cpan Geo-IP 1.51 main/done_testing().(); |