Test unmarshal nil for type duration

This commit is contained in:
9seconds
2021-04-01 16:56:07 +03:00
parent 1925efc2ec
commit e78c4d3bde
+6
View File
@@ -18,6 +18,12 @@ type TypeDurationTestSuite struct {
suite.Suite suite.Suite
} }
func (suite *TypeDurationTestSuite) TestUnmarshalNil() {
typ := &config.TypeDuration{}
suite.NoError(typ.UnmarshalText(nil))
suite.EqualValues(0, typ.Value(0))
}
func (suite *TypeDurationTestSuite) TestUnmarshalFail() { func (suite *TypeDurationTestSuite) TestUnmarshalFail() {
testData := []string{ testData := []string{
"1t", "1t",