Dont clobber anchor when adding nodes - fixes #1269

This commit is contained in:
Mike Farah
2022-07-13 11:12:15 +10:00
parent f3a8c4b2ec
commit f393cf37c2
4 changed files with 21 additions and 9 deletions
+9
View File
@@ -341,6 +341,15 @@ var addOperatorScenarios = []expressionScenario{
"D0, P[], (doc)::a: !horse [a, b]\nb: !goat [b]\n",
},
},
{
skipDoc: true,
description: "Keep anchors",
document: "a: &horse [1]",
expression: `.a += 2`,
expected: []string{
"D0, P[], (doc)::a: &horse [1, 2]\n",
},
},
}
func TestAddOperatorScenarios(t *testing.T) {