Added more tests

This commit is contained in:
Mike Farah 2021-06-10 09:53:50 +10:00
parent 58c63ed121
commit cb912ca188
2 changed files with 24 additions and 0 deletions

View File

@ -20,6 +20,14 @@ var booleanOperatorScenarios = []expressionScenario{
"D0, P[], (!!bool)::false\n",
},
},
{
skipDoc: true,
document: "b: false",
expression: `.b or .c`,
expected: []string{
"D0, P[b], (!!bool)::false\n",
},
},
{
skipDoc: true,
document: "b: hi",

View File

@ -12,6 +12,22 @@ var equalsOperatorScenarios = []expressionScenario{
"D0, P[], (!!bool)::true\n",
},
},
{
skipDoc: true,
document: `a: cat`,
expression: ".a == .b",
expected: []string{
"D0, P[a], (!!bool)::false\n",
},
},
{
skipDoc: true,
document: `a: cat`,
expression: ".b == .a",
expected: []string{
"D0, P[a], (!!bool)::false\n",
},
},
{
skipDoc: true,
document: "cat",