decode: allow subtables to be defined later (#750)

Fixes #739
This commit is contained in:
Thomas Pelletier
2022-04-07 21:49:16 -04:00
committed by GitHub
parent 88a8aecdd4
commit 89d7b412d8
3 changed files with 56 additions and 7 deletions
+29
View File
@@ -545,6 +545,35 @@ func TestUnmarshal(t *testing.T) {
}
},
},
{
desc: "issue 739 - table redefinition",
input: `
[foo.bar.baz]
wibble = 'wobble'
[foo]
[foo.bar]
huey = 'dewey'
`,
gen: func() test {
m := map[string]interface{}{}
return test{
target: &m,
expected: &map[string]interface{}{
`foo`: map[string]interface{}{
"bar": map[string]interface{}{
"huey": "dewey",
"baz": map[string]interface{}{
"wibble": "wobble",
},
},
},
},
}
},
},
{
desc: "multiline basic string",
input: `A = """\