Fixing TOML ArrayTable parsing issues #1758

This commit is contained in:
Mike Farah
2025-11-22 14:49:49 +11:00
parent 306dc931a5
commit 39fbf01fa8
2 changed files with 57 additions and 23 deletions
+21
View File
@@ -95,6 +95,20 @@ var emptyArrayTableThenTableExpected = `fruits:
animals: {}
`
var arrayTableThenArray = `
[[rootA.kidB]]
cat = "meow"
[rootA.kidB.kidC]
dog = "bark"`
var arrayTableThenArrayExpected = `rootA:
kidB:
- cat: meow
kidC:
dog: bark
`
var sampleArrayTable = `
[owner.contact]
name = "Tom Preston-Werner"
@@ -341,6 +355,13 @@ var tomlScenarios = []formatScenario{
expected: emptyArrayTableThenTableExpected,
scenarioType: "decode",
},
{
skipDoc: true,
description: "Parse: Array of Array Table; then table",
input: arrayTableThenArray,
expected: arrayTableThenArrayExpected,
scenarioType: "decode",
},
{
description: "Parse: Empty Table",
input: emptyTable,