Length compares to null instead of 0 issue #1427

This commit is contained in:
Mike Farah
2022-11-14 16:14:08 +11:00
parent 3e795d020d
commit ffc20f7e2c
6 changed files with 34 additions and 15 deletions
+4 -3
View File
@@ -76,9 +76,10 @@ var selectOperatorScenarios = []expressionScenario{
},
},
{
skipDoc: true,
document: `[{animal: cat, legs: {cool: true}}, {animal: fish}]`,
expression: `(.[] | select(.legs.cool == true).canWalk) = true | (.[] | .alive.things) = "yes"`,
description: "select does not update the map",
skipDoc: true,
document: `[{animal: cat, legs: {cool: true}}, {animal: fish}]`,
expression: `(.[] | select(.legs.cool == true).canWalk) = true | (.[] | .alive.things) = "yes"`,
expected: []string{
"D0, P[], (doc)::[{animal: cat, legs: {cool: true}, canWalk: true, alive: {things: yes}}, {animal: fish, alive: {things: yes}}]\n",
},