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

Function mustCompileExpr

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

ErrMethod · 0.80
CompileMethod · 0.65

Tested by

no test coverage detected