Improvments on expressions, gw tests
This commit is contained in:
+6
-2
@@ -3,7 +3,6 @@ package expr
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/PaesslerAG/gval"
|
||||
)
|
||||
|
||||
@@ -71,7 +70,12 @@ func (e *gvalEval) Eval(ctx context.Context, scope *Vars) (interface{}, error) {
|
||||
}
|
||||
|
||||
func (e *gvalEval) Test(ctx context.Context, scope *Vars) (bool, error) {
|
||||
return e.evaluable.EvalBool(ctx, scope.Dict())
|
||||
r, err := e.evaluable(ctx, scope.Dict())
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return !isEmpty(r), nil
|
||||
}
|
||||
|
||||
func Parser(ll ...gval.Language) gval.Language {
|
||||
|
||||
Reference in New Issue
Block a user