Explorar el Código

Test unmarshal nil for type bytes

tags/v2.0.0-rc1
9seconds hace 5 años
padre
commit
1925efc2ec
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. 2
    2
      config/type_blocklist_uri_test.go
  2. 6
    0
      config/type_bytes_test.go

+ 2
- 2
config/type_blocklist_uri_test.go Ver fichero

@@ -30,12 +30,12 @@ func (suite *TypeBlocklistURITestSuite) TestUnmarshalNil() {
30 30
 
31 31
 func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() {
32 32
 	typ := &config.TypeBlocklistURI{}
33
-    suite.Error(typ.UnmarshalText([]byte("gopher://lalala")))
33
+	suite.Error(typ.UnmarshalText([]byte("gopher://lalala")))
34 34
 }
35 35
 
36 36
 func (suite *TypeBlocklistURITestSuite) TestEmptyHost() {
37 37
 	typ := &config.TypeBlocklistURI{}
38
-    suite.Error(typ.UnmarshalText([]byte("https:///path")))
38
+	suite.Error(typ.UnmarshalText([]byte("https:///path")))
39 39
 }
40 40
 
41 41
 func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() {

+ 6
- 0
config/type_bytes_test.go Ver fichero

@@ -17,6 +17,12 @@ type TypeBytesTestSuite struct {
17 17
 	suite.Suite
18 18
 }
19 19
 
20
+func (suite *TypeBytesTestSuite) TestUnmarshalNil() {
21
+	typ := &config.TypeBytes{}
22
+	suite.NoError(typ.UnmarshalText(nil))
23
+	suite.Empty(typ.String())
24
+}
25
+
20 26
 func (suite *TypeBytesTestSuite) TestUnmarshalFail() {
21 27
 	testData := []string{
22 28
 		"1m",

Loading…
Cancelar
Guardar