This commit is contained in:
Thomas Pelletier
2021-03-30 21:53:01 -04:00
parent 739ceda96c
commit 7ccacf158e
+20
View File
@@ -760,6 +760,26 @@ version = "0.1.0"`)
assert.Equal(t, expected, a)
}
func TestIssue252(t *testing.T) {
type config struct {
Val1 string `toml:"val1"`
Val2 string `toml:"val2"`
}
var configFile = []byte(
`
val1 = "test1"
`)
cfg := &config{
Val2: "test2",
}
err := toml.Unmarshal(configFile, cfg)
require.NoError(t, err)
require.Equal(t, "test2", cfg.Val2)
}
func TestUnmarshalDecodeErrors(t *testing.T) {
examples := []struct {
desc string