(t *testing.T)
| 32 | ) |
| 33 | |
| 34 | func 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 | |
| 49 | func TestRuleComposerError(t *testing.T) { |
| 50 | env, err := cel.NewEnv() |