fix: coerce booleans to numbers for comparison in exprparser (#1030)
Co-Authored-By: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: Markus Wolf <markus.wolf@new-work.se> Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
@@ -121,6 +121,10 @@ func TestOperatorsCompare(t *testing.T) {
|
||||
{`0 == '' }}`, true, "string-0-coercion-alt"},
|
||||
{`3 == '3' }}`, true, "string-3-coercion-alt"},
|
||||
{`'TEST' == 'test' }}`, true, "string-casing"},
|
||||
{"true > false }}", true, "bool-greater-than"},
|
||||
{"true >= false }}", true, "bool-greater-than-eq"},
|
||||
{"true >= true }}", true, "bool-greater-than-1"},
|
||||
{"true != false }}", true, "bool-not-equal"},
|
||||
{`fromJSON('{}') < 2 }}`, false, "object-with-less"},
|
||||
{`fromJSON('{}') < fromJSON('[]') }}`, false, "object/arr-with-lt"},
|
||||
{`fromJSON('{}') > fromJSON('[]') }}`, false, "object/arr-with-gt"},
|
||||
|
Reference in New Issue
Block a user