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

Function mustCompileExpr

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

ErrMethod · 0.80
CompileMethod · 0.65

Tested by

no test coverage detected