MCPcopy Create free account
hub / github.com/cel-expr/cel-go / interpret

Function interpret

cel/cel_test.go:4013–4024  ·  view source on GitHub ↗
(t testing.TB, env *Env, expr string, vars any)

Source from the content-addressed store, hash-verified

4011}
4012
4013func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) {
4014 t.Helper()
4015 prg, err := compileOrError(t, env, expr)
4016 if err != nil {
4017 return nil, err
4018 }
4019 out, _, err := prg.Eval(vars)
4020 if err != nil {
4021 return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err)
4022 }
4023 return out, nil
4024}
4025
4026func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) {
4027 env, err := NewEnv(ParserExpressionSizeLimit(1000))

Callers 9

TestCustomEnvFunction · 0.85
TestMacroSubsetFunction · 0.85
TestParserRecursionLimitFunction · 0.85
TestQuotedFieldsFunction · 0.85
TestDynamicDispatchFunction · 0.85

Calls 2

compileOrErrorFunction · 0.85
EvalMethod · 0.65

Tested by

no test coverage detected