Browse Source

Update test coverage for typeblocklisturi

tags/v2.0.0-rc1
9seconds 5 years ago
parent
commit
9562a86038
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      config/type_blocklist_uri_test.go

+ 16
- 0
config/type_blocklist_uri_test.go View File

@@ -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
 

Loading…
Cancel
Save