From patchwork Thu Sep 10 15:57:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 3453 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp60klKz3x3T for ; Thu, 10 Sep 2020 15:58:06 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BnNp442qHzyH; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BnNp43cvkz30WJ; Thu, 10 Sep 2020 15:58:04 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BnNp26Np6z2yVt; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BnNp228CyzQv; Thu, 10 Sep 2020 15:58:02 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MHiYE3aJF4ckUbMd78N3cVcAYeqMJ3ElxS+WWmenB2M=; b=BAD8DoDVOh/HGB4f8IshIcf+CObNz01ABYDOBZZyVnSftRygVECXZkoMkwSLMsfNbpJDuj 13P3zic+VNf03XCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1599753482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MHiYE3aJF4ckUbMd78N3cVcAYeqMJ3ElxS+WWmenB2M=; b=eGjqTlGyv6oBnfpilXGGJRTOBzJuraSwYU1xvYOmAIXEjCYGkyEVLV6oh+qBC2dxWz6O6y grezO1EhNuTAUVMidmB7dP6AJQo4xt51gx6f40XeOkAbdySSng5K+sDqkUj/s1IiKn3xAw gh7rZd6LrH4lX3CTaVNPG6V9rX57N4kXSPrqvQChHIBlwRkHJbDv5ZTd0PD+1P+aKrmi9n QAuiqISml9j00wIei1+mpm0o06PCowLhoPLOTIf8OY+WeONAwdVZ+boX2v5jVwNmoINxGW 256FCNCdvhsCgjeFod0F+xY9HHefurRkVxZaG6fYo972k78MzqqOEzfHmtTdNQ== From: Stefan Schantl To: location@lists.ipfire.org Subject: [PATCH 3/4] perl: Add test for get_country_name() function. Date: Thu, 10 Sep 2020 17:57:46 +0200 Message-Id: <20200910155747.12553-3-stefan.schantl@ipfire.org> In-Reply-To: <20200910155747.12553-1-stefan.schantl@ipfire.org> References: <20200910155747.12553-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Authentication-Results: mail01.ipfire.org; auth=pass smtp.mailfrom=stefan.schantl@ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: development@lists.ipfire.org Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Stefan Schantl --- src/perl/t/Location.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/perl/t/Location.t b/src/perl/t/Location.t index a82bbb1..c922a94 100644 --- a/src/perl/t/Location.t +++ b/src/perl/t/Location.t @@ -12,7 +12,7 @@ use warnings; my $testdb = $ENV{'database'}; my $keyfile = $ENV{'keyfile'}; -use Test::More tests => 10; +use Test::More tests => 11; BEGIN { use_ok('Location') }; ######################### @@ -65,3 +65,6 @@ 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."); + +my $country_name = &Location::get_country_name($db, "DE"); +ok($country_name eq "Germany", "Test 13 - Got country name: $country_name");