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

Function TestCompile

policy/compiler_test.go:34–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32)
33
34func TestCompile(t *testing.T) {
35 for _, tst := range policyTests {
36 tc := tst
37 t.Run(tc.name, func(t *testing.T) {
38 r := newRunner(tc.name, tc.expr, tc.parseOpts)
39 env, ast, iss := r.compile(t, tc.envOpts, []CompilerOption{})
40 if iss.Err() != nil {
41 t.Fatalf("Compile(%s) failed: %v", r.name, iss.Err())
42 }
43 r.setup(t, env, ast)
44 r.run(t)
45 })
46 }
47}
48
49func TestRuleComposerError(t *testing.T) {
50 env, err := cel.NewEnv()

Callers

nothing calls this directly

Calls 5

newRunnerFunction · 0.85
compileMethod · 0.80
ErrMethod · 0.80
setupMethod · 0.80
runMethod · 0.80

Tested by

no test coverage detected