mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
Fix deleting commented empty list YAML output (#2765)
This commit is contained in:
@@ -119,6 +119,19 @@ var deleteOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (!!map)::a: []\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Delete all entries from list with inline key comment",
|
||||
document: `testList: # A comment
|
||||
- name: test1
|
||||
value: 123
|
||||
- name: test2
|
||||
value: 456`,
|
||||
expression: `del(.testList[])`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!map)::testList: [] # A comment\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Delete entry appended to an array",
|
||||
|
||||
Reference in New Issue
Block a user