mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Assignment op no longer clobbers anchor (#1029)
This commit is contained in:
@@ -145,6 +145,16 @@ var assignOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (doc)::{a: {b: bogs}}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Update node value that has an anchor",
|
||||
subdescription: "Anchor will remaple",
|
||||
dontFormatInputForDoc: true,
|
||||
document: `a: &cool cat`,
|
||||
expression: `.a = "dog"`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::a: &cool dog\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Update empty object and array",
|
||||
dontFormatInputForDoc: true,
|
||||
|
||||
Reference in New Issue
Block a user