]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
perl: Add test for the database_countries() function.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 20 Aug 2020 17:28:56 +0000 (19:28 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Aug 2020 09:56:06 +0000 (09:56 +0000)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/perl/t/Location.t

index 3ba2d8ff4c8d40f3b0751e0e34074744a84dfebd..ec7f1e0aabc99d411682b5ab65cd241690208e46 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 my $testdb = $ENV{'database'};
 my $keyfile = $ENV{'keyfile'};
 
-use Test::More tests => 7;
+use Test::More tests => 8;
 BEGIN { use_ok('Location') };
 
 #########################
@@ -56,3 +56,6 @@ if(defined($as_number)) { fail("Test 8 - Lookup Autonomous System Number for add
 
 $as_number = &Location::lookup_asn($db, "a.b.c.d");
 if(defined($as_number)) { fail("Test 9 - Lookup Autonomous System Number for invalid address.") }
+
+my @locations = &Location::database_countries($db);
+ok(@locations != 0, "Test 10 - Get database countries.");