diff --git a/unmarshaler_test.go b/unmarshaler_test.go index 070a40cd..78e06895 100644 --- a/unmarshaler_test.go +++ b/unmarshaler_test.go @@ -2847,6 +2847,27 @@ func TestIssue931(t *testing.T) { } func TestIssue931Interface(t *testing.T) { + type items struct { + Slice interface{} + } + + type item = map[string]interface{} + + its := items{[]interface{}{item{"Name": "a"}, item{"Name": "b"}}} + + b := []byte(` + [[Slice]] + Name = 'c' + +[[Slice]] + Name = 'd' + `) + + toml.Unmarshal(b, &its) + require.Equal(t, items{[]interface{}{item{"Name": "c"}, item{"Name": "d"}}}, its) +} + +func TestIssue931SliceInterface(t *testing.T) { type items struct { Slice []interface{} }