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

Function mustCompileExpr

policy/compiler_test.go:475–482  ·  view source on GitHub ↗
(t testing.TB, env *cel.Env, expr string)

Source from the content-addressed store, hash-verified

473}
474
475func mustCompileExpr(t testing.TB, env *cel.Env, expr string) *cel.Ast {
476 t.Helper()
477 out, iss := env.Compile(expr)
478 if iss.Err() != nil {
479 t.Fatalf("env.Compile(%s) failed: %v", expr, iss.Err())
480 }
481 return out
482}
483
484func parsePolicy(t testing.TB, name string, parseOpts []ParserOption) *Policy {
485 t.Helper()

Callers 1

Calls 2

ErrMethod · 0.80
CompileMethod · 0.65

Tested by

no test coverage detected