Browse Source

Test unmarshal nil for type duration

tags/v2.0.0-rc1
9seconds 5 years ago
parent
commit
e78c4d3bde
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      config/type_duration_test.go

+ 6
- 0
config/type_duration_test.go View File

@@ -18,6 +18,12 @@ type TypeDurationTestSuite struct {
18 18
 	suite.Suite
19 19
 }
20 20
 
21
+func (suite *TypeDurationTestSuite) TestUnmarshalNil() {
22
+	typ := &config.TypeDuration{}
23
+	suite.NoError(typ.UnmarshalText(nil))
24
+	suite.EqualValues(0, typ.Value(0))
25
+}
26
+
21 27
 func (suite *TypeDurationTestSuite) TestUnmarshalFail() {
22 28
 	testData := []string{
23 29
 		"1t",

Loading…
Cancel
Save