From 9562a8603892731b8e70744c496c1d4909075856 Mon Sep 17 00:00:00 2001 From: 9seconds Date: Thu, 1 Apr 2021 16:51:38 +0300 Subject: [PATCH] Update test coverage for typeblocklisturi --- config/type_blocklist_uri_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/type_blocklist_uri_test.go b/config/type_blocklist_uri_test.go index e0b8974..6ced8ac 100644 --- a/config/type_blocklist_uri_test.go +++ b/config/type_blocklist_uri_test.go @@ -22,6 +22,22 @@ type TypeBlocklistURITestSuite struct { suite.Suite } +func (suite *TypeBlocklistURITestSuite) TestUnmarshalNil() { + typ := &config.TypeBlocklistURI{} + suite.NoError(typ.UnmarshalText(nil)) + suite.Empty(typ.String()) +} + +func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() { + typ := &config.TypeBlocklistURI{} + suite.Error(typ.UnmarshalText([]byte("gopher://lalala"))) +} + +func (suite *TypeBlocklistURITestSuite) TestEmptyHost() { + typ := &config.TypeBlocklistURI{} + suite.Error(typ.UnmarshalText([]byte("https:///path"))) +} + func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() { rnd := make([]byte, 48)