File: Reader-Connection-Type.t

package info (click to toggle)
libgeoip2-perl 2.006002-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,156 kB
  • sloc: perl: 2,275; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 617 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;

use Test::More;
use Test::Fatal;

use GeoIP2::Database::Reader;
use Path::Class qw( file );

{
    my $reader
        = GeoIP2::Database::Reader->new( file =>
            file(qw( maxmind-db test-data GeoIP2-Connection-Type-Test.mmdb ))
        );

    my $ip_address = '1.0.1.0';
    my $ct         = $reader->connection_type( ip => $ip_address );
    is(
        $ct->connection_type, 'Cable/DSL',
        'correct connection type in Connection-Type database'
    );
    is(
        $ct->ip_address, $ip_address,
        'correct IP in Connection-Type database'
    );
}

done_testing();