@@ -457,35 +457,6 @@ func TestEmptytomlUnmarshal(t *testing.T) {
|
||||
assert.Equal(t, emptyTestData, result)
|
||||
}
|
||||
|
||||
func TestEmptyUnmarshalOmit(t *testing.T) {
|
||||
t.Skipf("Have not figured yet if omitempty is a good idea")
|
||||
|
||||
type emptyMarshalTestStruct2 struct {
|
||||
Title string `toml:"title"`
|
||||
Bool bool `toml:"bool,omitempty"`
|
||||
Int int `toml:"int, omitempty"`
|
||||
String string `toml:"string,omitempty "`
|
||||
StringList []string `toml:"stringlist,omitempty"`
|
||||
Ptr *basicMarshalTestStruct `toml:"ptr,omitempty"`
|
||||
Map map[string]string `toml:"map,omitempty"`
|
||||
}
|
||||
|
||||
emptyTestData2 := emptyMarshalTestStruct2{
|
||||
Title: "Placeholder",
|
||||
Bool: false,
|
||||
Int: 0,
|
||||
String: "",
|
||||
StringList: []string{},
|
||||
Ptr: nil,
|
||||
Map: map[string]string{},
|
||||
}
|
||||
|
||||
result := emptyMarshalTestStruct2{}
|
||||
err := toml.Unmarshal(emptyTestToml, &result)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, emptyTestData2, result)
|
||||
}
|
||||
|
||||
type pointerMarshalTestStruct struct {
|
||||
Str *string
|
||||
List *[]string
|
||||
|
||||
Reference in New Issue
Block a user