-
-
Notifications
You must be signed in to change notification settings - Fork 464
Open
Labels
Description
In this case, I do expr.Compile
with expr.AsBool()
, and expect expr.Run
will return output == false
and err == nil
.
But instead, it return output == nil
and err == nil
, which violate the expr.AsBool()
command.
import (
"github.com/expr-lang/expr"
"github.com/stretchr/testify/assert"
)
func Test_expr(t *testing.T) {
program, err = expr.Compile("varNotExist", expr.AllowUndefinedVariables(), expr.AsBool())
assert.Nil(t, err)
output, err = expr.Run(program, map[string]interface{}{})
assert.Nil(t, err)
assert.Equal(t, nil, output)
}