mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Length (and some other operators) should not include head/foot comments #1231
This commit is contained in:
@@ -44,6 +44,15 @@ var reverseOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (!!seq)::[{a: cat}, {a: banana}, {a: apple}]\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Sort descending by string field, with comments",
|
||||
skipDoc: true,
|
||||
document: "# abc\n[{a: banana},{a: cat},{a: apple}]\n# xyz",
|
||||
expression: `sort_by(.a) | reverse`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!seq)::# abc\n[{a: cat}, {a: banana}, {a: apple}]\n# xyz\n",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestReverseOperatorScenarios(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user