unmarshal: fix non-terminated array error

Fixes #581
This commit is contained in:
Thomas Pelletier
2021-09-07 10:19:45 -04:00
committed by Thomas Pelletier
parent 40cfb6f458
commit 7e2fa1bc80
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -1728,6 +1728,12 @@ func TestIssue579(t *testing.T) {
require.Error(t, err)
}
func TestIssue581(t *testing.T) {
var v interface{}
err := toml.Unmarshal([]byte(`P=[#`), &v)
require.Error(t, err)
}
//nolint:funlen
func TestUnmarshalDecodeErrors(t *testing.T) {
examples := []struct {