decoder: add test for #507

This commit is contained in:
Thomas Pelletier
2021-04-15 11:34:59 -04:00
parent 2eff2d082a
commit 0537b928df
+7
View File
@@ -818,6 +818,13 @@ bar = 2021-04-08
require.NoError(t, err)
}
func TestIssue507(t *testing.T) {
data := []byte{'0', '=', '\n', '0', 'a', 'm', 'e'}
m := map[string]interface{}{}
err := toml.Unmarshal(data, &m)
require.Error(t, err)
}
func TestUnmarshalDecodeErrors(t *testing.T) {
examples := []struct {
desc string