mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +08:00
now assumes yaml idiomatic formatting when adding to empty maps/arrays
This commit is contained in:
@@ -35,6 +35,22 @@ var traversePathOperatorScenarios = []expressionScenario{
|
||||
"D0, P[0 0], (!!int)::1\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `blah: {}`,
|
||||
expression: `.blah.cat = "cool"`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::blah:\n cat: cool\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `blah: []`,
|
||||
expression: `.blah.0 = "cool"`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::blah:\n - cool\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `b: cat`,
|
||||
|
||||
Reference in New Issue
Block a user