Skip to content

Commit

Permalink
Resync tests with PP repo
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Mar 23, 2016
1 parent c437762 commit b71aeb6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
3 changes: 3 additions & 0 deletions t/MaxMind/DB/Reader-broken-databases.t
Expand Up @@ -6,6 +6,9 @@ use Test::Fatal;
use Test::More;

use lib 't/lib';

# This must come before `use MaxMind::DB::Reader;` as otherwise the wrong
# reader may be loaded
use Test::MaxMind::DB::Reader;

use MaxMind::DB::Reader;
Expand Down
8 changes: 6 additions & 2 deletions t/MaxMind/DB/Reader-decoder.t
Expand Up @@ -9,9 +9,13 @@ use Test::Requires {
};

use lib 't/lib';

# This must come before `use MaxMind::DB::Reader;` as otherwise the wrong
# reader may be loaded
use Test::MaxMind::DB::Reader;

use Math::Int128 qw( uint128 );
use MaxMind::DB::Reader;
use Test::MaxMind::DB::Reader;
use Test::More;
use Test::Number::Delta;

Expand Down Expand Up @@ -59,7 +63,7 @@ my $reader
{
mapX => {
utf8_stringX => 'hello',
arrayX => [ 7, 8, 9 ],
arrayX => [ 7, 8, 9 ],
},
},
'decoded map has expected value'
Expand Down
3 changes: 3 additions & 0 deletions t/MaxMind/DB/Reader-no-ipv4-search-tree.t
Expand Up @@ -6,6 +6,9 @@ use Test::Fatal;
use Test::More;

use lib 't/lib';

# This must come before `use MaxMind::DB::Reader;` as otherwise the wrong
# reader may be loaded
use Test::MaxMind::DB::Reader;

use MaxMind::DB::Reader;
Expand Down
20 changes: 19 additions & 1 deletion t/MaxMind/DB/Reader.t
Expand Up @@ -3,11 +3,15 @@ use warnings;
use autodie;

use lib 't/lib';

# This must come before `use MaxMind::DB::Reader;` as otherwise the wrong
# reader may be loaded
use Test::MaxMind::DB::Reader;

use MaxMind::DB::Reader;
use Path::Class qw( file );
use Test::Fatal;
use Test::MaxMind::DB::Common::Util qw( standard_test_metadata );
use Test::MaxMind::DB::Reader;
use Test::More;

for my $record_size ( 24, 28, 32 ) {
Expand Down Expand Up @@ -157,6 +161,20 @@ SKIP:
);
}

{
my $mmdb_record
= MaxMind::DB::Reader->new(
file => 'maxmind-db/test-data/GeoIP2-Domain-Test.mmdb' )
->record_for_address('2002:47a0:df00:0:0:0:0:0');
ok( $mmdb_record, 'found record for expanded IPv6 address' );

is(
$mmdb_record->{domain}, 'verizon.net',
'expanded IPv6 address has expected data'
);

}

done_testing();

sub _test_ipv4_lookups {
Expand Down
7 changes: 6 additions & 1 deletion t/MaxMind/DB/Reader/NoMoose.t
@@ -1,8 +1,13 @@
use strict;
use warnings;

use MaxMind::DB::Reader;
use lib 't/lib';

# This must come before `use MaxMind::DB::Reader;` as otherwise the wrong
# reader may be loaded
use Test::MaxMind::DB::Reader;

use MaxMind::DB::Reader;
use Test::More;

ok( !exists $INC{'Moose.pm'}, 'Moose.pm is not in %INC' );
Expand Down

0 comments on commit b71aeb6

Please sign in to comment.