Generalising the empty array fix to map

This commit is contained in:
Mike Farah
2026-08-03 13:31:47 +10:00
parent b74aefd55f
commit 7862131c9c
5 changed files with 19 additions and 7 deletions
+11
View File
@@ -132,6 +132,17 @@ var deleteOperatorScenarios = []expressionScenario{
"D0, P[], (!!map)::testList: [] # A comment\n",
},
},
{
skipDoc: true,
description: "Delete all entries from map with inline key comment",
document: `testMap: # A comment
name: test1
value: 123`,
expression: `del(.testMap[])`,
expected: []string{
"D0, P[], (!!map)::testMap: {} # A comment\n",
},
},
{
skipDoc: true,
description: "Delete entry appended to an array",