Fix error report of type mismatch on inline tables (#853)
Parser did not track the location of the faulty inline table in the document, and unmarshaler tried to the use the non-raw data field of the AST node, both resulting into a panic when generating the parser error. Fixes #850
This commit is contained in:
@@ -2466,6 +2466,12 @@ func TestIssue807(t *testing.T) {
|
||||
require.Equal(t, "foo", m.Name)
|
||||
}
|
||||
|
||||
func TestIssue850(t *testing.T) {
|
||||
data := make(map[string]string)
|
||||
err := toml.Unmarshal([]byte("foo = {}"), &data)
|
||||
require.Error(t, err)
|
||||
}
|
||||
|
||||
func TestUnmarshalDecodeErrors(t *testing.T) {
|
||||
examples := []struct {
|
||||
desc string
|
||||
|
||||
Reference in New Issue
Block a user