mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 18:24:57 +08:00
Fixing TOML ArrayTable parsing issues #1758
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user