Update test coverage for typeblocklisturi

This commit is contained in:
9seconds
2021-04-01 16:51:38 +03:00
parent 21d4f3d101
commit 9562a86038
+16
View File
@@ -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)