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

Function interpret

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

Source from the content-addressed store, hash-verified

4408}
4409
4410func interpret(t testing.TB, env *Env, expr string, vars any) (ref.Val, error) {
4411 t.Helper()
4412 prg, err := compileOrError(t, env, expr)
4413 if err != nil {
4414 return nil, err
4415 }
4416 out, _, err := prg.Eval(vars)
4417 if err != nil {
4418 return nil, fmt.Errorf("prg.Eval(%v) failed: %v", vars, err)
4419 }
4420 return out, nil
4421}
4422
4423func TestExpressionSizeLimitEarlyEnforcement(t *testing.T) {
4424 env, err := NewEnv(ParserExpressionSizeLimit(1000))

Callers 10

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