From 1925efc2ec459799d83dc864dff6298930b9f505 Mon Sep 17 00:00:00 2001 From: 9seconds Date: Thu, 1 Apr 2021 16:53:48 +0300 Subject: [PATCH] Test unmarshal nil for type bytes --- config/type_blocklist_uri_test.go | 4 ++-- config/type_bytes_test.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/type_blocklist_uri_test.go b/config/type_blocklist_uri_test.go index 6ced8ac..6e0b260 100644 --- a/config/type_blocklist_uri_test.go +++ b/config/type_blocklist_uri_test.go @@ -30,12 +30,12 @@ func (suite *TypeBlocklistURITestSuite) TestUnmarshalNil() { func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() { typ := &config.TypeBlocklistURI{} - suite.Error(typ.UnmarshalText([]byte("gopher://lalala"))) + suite.Error(typ.UnmarshalText([]byte("gopher://lalala"))) } func (suite *TypeBlocklistURITestSuite) TestEmptyHost() { typ := &config.TypeBlocklistURI{} - suite.Error(typ.UnmarshalText([]byte("https:///path"))) + suite.Error(typ.UnmarshalText([]byte("https:///path"))) } func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() { diff --git a/config/type_bytes_test.go b/config/type_bytes_test.go index 6baec1c..c9ff55a 100644 --- a/config/type_bytes_test.go +++ b/config/type_bytes_test.go @@ -17,6 +17,12 @@ type TypeBytesTestSuite struct { suite.Suite } +func (suite *TypeBytesTestSuite) TestUnmarshalNil() { + typ := &config.TypeBytes{} + suite.NoError(typ.UnmarshalText(nil)) + suite.Empty(typ.String()) +} + func (suite *TypeBytesTestSuite) TestUnmarshalFail() { testData := []string{ "1m",