From 64eb519c4b77cff1071059f1f41acfd0e3ea9513 Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Thu, 22 Jun 2023 14:23:07 +0300 Subject: [PATCH] home: add test case --- internal/home/dns_internal_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/home/dns_internal_test.go b/internal/home/dns_internal_test.go index f21a96c49f2..7b7e0fb22af 100644 --- a/internal/home/dns_internal_test.go +++ b/internal/home/dns_internal_test.go @@ -13,8 +13,9 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) { filtering.InitModule() var ( - globalBlockedServices = []string{"ok"} - clientBlockedServices = []string{"ok", "mail_ru", "vk"} + globalBlockedServices = []string{"ok"} + clientBlockedServices = []string{"ok", "mail_ru", "vk"} + nonValidBlockedServices = []string{"non_valid"} err error ) @@ -38,6 +39,10 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) { BlockedServices: clientBlockedServices, UseOwnBlockedServices: true, }, + "client_4": { + BlockedServices: nonValidBlockedServices, + UseOwnBlockedServices: true, + }, } testCases := []struct { @@ -58,6 +63,10 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) { name: "custom_settings_block", id: "client_3", wantLen: len(clientBlockedServices), + }, { + name: "custom_settings_non_valid", + id: "client_4", + wantLen: 0, }} for _, tc := range testCases {