]> git.ipfire.org Git - location/libloc.git/commitdiff
perl: Add test for the lookup_network_has_flag() function
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 30 Aug 2020 10:36:02 +0000 (12:36 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 31 Aug 2020 10:03:47 +0000 (10:03 +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 0d9a1a5c67bb3bf20e227b5509be38ff4371364e..a82bbb1bcff53839101cd96cd4f6daa5ef67edf6 100644 (file)
@@ -12,7 +12,7 @@ use warnings;
 my $testdb = $ENV{'database'};
 my $keyfile = $ENV{'keyfile'};
 
-use Test::More tests => 9;
+use Test::More tests => 10;
 BEGIN { use_ok('Location') };
 
 #########################
@@ -62,3 +62,6 @@ ok($as_name eq "Lightning Wire Labs GmbH", "Test 10 - Get name for AS204867.");
 
 my @locations = &Location::database_countries($db);
 ok(@locations != 0, "Test 11 - Get database countries.");
+
+my $network_flag_anycast = &Location::lookup_network_has_flag($db, $address, "LOC_NETWORK_FLAG_ANYCAST");
+ok($network_flag_anycast, "Network has Anycast flag.");