Assignment op no longer clobbers anchor (#1029)

This commit is contained in:
Mike Farah
2021-12-03 09:23:24 +11:00
parent 7d89102477
commit dba41ffed7
5 changed files with 58 additions and 12 deletions
+10
View File
@@ -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,