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)