Added another comment test

This commit is contained in:
Mike Farah
2022-09-30 10:15:41 +10:00
parent be304a1102
commit 3dd5f0c80c
3 changed files with 29 additions and 2 deletions
+8
View File
@@ -64,6 +64,14 @@ var commentOperatorScenarios = []expressionScenario{
"D0, P[], (doc)::# single\n\na: cat\n",
},
},
{
description: "Set head comment of a map entry",
document: "f: foo\na:\n b: cat",
expression: `(.a | key) head_comment="single"`,
expected: []string{
"D0, P[], (doc)::f: foo\n# single\na:\n b: cat\n",
},
},
{
description: "Set foot comment, using an expression",
document: `a: cat`,