mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 18:24:57 +08:00
Fixing add when there is no node match #2325
This commit is contained in:
@@ -310,6 +310,15 @@ var addOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (!!map)::a: !cat Saturday, 15-Dec-01 at 6:00AM GMT\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Add to empty",
|
||||
subdescription: "should behave like null",
|
||||
expression: `.nada + "cat"`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!str)::cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Add to null",
|
||||
subdescription: "Adding to null simply returns the rhs",
|
||||
|
||||
Reference in New Issue
Block a user