mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 00:54:01 +03:00
Test unmarshal nil for type bytes
This commit is contained in:
@@ -30,12 +30,12 @@ func (suite *TypeBlocklistURITestSuite) TestUnmarshalNil() {
|
|||||||
|
|
||||||
func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() {
|
func (suite *TypeBlocklistURITestSuite) TestUnknownSchema() {
|
||||||
typ := &config.TypeBlocklistURI{}
|
typ := &config.TypeBlocklistURI{}
|
||||||
suite.Error(typ.UnmarshalText([]byte("gopher://lalala")))
|
suite.Error(typ.UnmarshalText([]byte("gopher://lalala")))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *TypeBlocklistURITestSuite) TestEmptyHost() {
|
func (suite *TypeBlocklistURITestSuite) TestEmptyHost() {
|
||||||
typ := &config.TypeBlocklistURI{}
|
typ := &config.TypeBlocklistURI{}
|
||||||
suite.Error(typ.UnmarshalText([]byte("https:///path")))
|
suite.Error(typ.UnmarshalText([]byte("https:///path")))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() {
|
func (suite *TypeBlocklistURITestSuite) TestUnmarshalFail() {
|
||||||
|
|||||||
@@ -17,6 +17,12 @@ type TypeBytesTestSuite struct {
|
|||||||
suite.Suite
|
suite.Suite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (suite *TypeBytesTestSuite) TestUnmarshalNil() {
|
||||||
|
typ := &config.TypeBytes{}
|
||||||
|
suite.NoError(typ.UnmarshalText(nil))
|
||||||
|
suite.Empty(typ.String())
|
||||||
|
}
|
||||||
|
|
||||||
func (suite *TypeBytesTestSuite) TestUnmarshalFail() {
|
func (suite *TypeBytesTestSuite) TestUnmarshalFail() {
|
||||||
testData := []string{
|
testData := []string{
|
||||||
"1m",
|
"1m",
|
||||||
|
|||||||
Reference in New Issue
Block a user