Fixed boolean op with empty context issue

This commit is contained in:
Mike Farah
2021-05-09 12:44:05 +10:00
parent 25d0787011
commit 37f3e21970
6 changed files with 111 additions and 14 deletions
+16
View File
@@ -87,6 +87,22 @@ var equalsOperatorScenarios = []expressionScenario{
"D0, P[], (!!bool)::true\n",
},
},
{
description: "Non exisitant key doesn't equal a value",
document: "a: frog",
expression: `select(.b != "thing")`,
expected: []string{
"D0, P[], (doc)::a: frog\n",
},
},
{
description: "Two non existant keys are equal",
document: "a: frog",
expression: `select(.b == .c)`,
expected: []string{
"D0, P[], (doc)::a: frog\n",
},
},
}
func TestEqualOperatorScenarios(t *testing.T) {