|
|
@@ -22,6 +22,22 @@ type TypeBlocklistURITestSuite struct {
|
|
22
|
22
|
suite.Suite
|
|
23
|
23
|
}
|
|
24
|
24
|
|
|
|
25
|
+func (suite *TypeBlocklistURITestSuite) TestUnmarshalNil() {
|
|
|
26
|
+ typ := &config.TypeBlocklistURI{}
|
|
|
27
|
+ suite.NoError(typ.UnmarshalText(nil))
|
|
|
28
|
+ suite.Empty(typ.String())
|
|
|
29
|
+}
|
|
|
30
|
+
|
|
|
31
|
+func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() {
|
|
|
32
|
+ typ := &config.TypeBlocklistURI{}
|
|
|
33
|
+ suite.Error(typ.UnmarshalText([]byte("gopher://lalala")))
|
|
|
34
|
+}
|
|
|
35
|
+
|
|
|
36
|
+func (suite *TypeBlocklistURITestSuite) TestEmptyHost() {
|
|
|
37
|
+ typ := &config.TypeBlocklistURI{}
|
|
|
38
|
+ suite.Error(typ.UnmarshalText([]byte("https:///path")))
|
|
|
39
|
+}
|
|
|
40
|
+
|
|
25
|
41
|
func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() {
|
|
26
|
42
|
rnd := make([]byte, 48)
|
|
27
|
43
|
|