parser: don't crash on unterminated table key (#580)

* parser: don't crash on unterminated table key

Fixes #579

* parser: fix format of error returned by expect

EOF was missing the format string and %U is not very human friendly.
This commit is contained in:
Thomas Pelletier
2021-09-06 12:18:45 -04:00
committed by GitHub
parent 1230ca485e
commit 40cfb6f458
2 changed files with 11 additions and 1 deletions
+6
View File
@@ -1722,6 +1722,12 @@ func TestIssue507(t *testing.T) {
require.Error(t, err)
}
func TestIssue579(t *testing.T) {
var v interface{}
err := toml.Unmarshal([]byte(`[foo`), &v)
require.Error(t, err)
}
//nolint:funlen
func TestUnmarshalDecodeErrors(t *testing.T) {
examples := []struct {