From e78c4d3bdec3553bbcaaa4f3b475a1566b4f14e2 Mon Sep 17 00:00:00 2001 From: 9seconds Date: Thu, 1 Apr 2021 16:56:07 +0300 Subject: [PATCH] Test unmarshal nil for type duration --- config/type_duration_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/type_duration_test.go b/config/type_duration_test.go index be9a8fe..c31d3ef 100644 --- a/config/type_duration_test.go +++ b/config/type_duration_test.go @@ -18,6 +18,12 @@ type TypeDurationTestSuite struct { suite.Suite } +func (suite *TypeDurationTestSuite) TestUnmarshalNil() { + typ := &config.TypeDuration{} + suite.NoError(typ.UnmarshalText(nil)) + suite.EqualValues(0, typ.Value(0)) +} + func (suite *TypeDurationTestSuite) TestUnmarshalFail() { testData := []string{ "1t",