(t testing.TB, name string, policySource string, envOpts []cel.EnvOption, compilerOpts []CompilerOption)
| 259 | } |
| 260 | |
| 261 | func parseAndCompilePolicy(t testing.TB, name string, policySource string, envOpts []cel.EnvOption, compilerOpts []CompilerOption) (*cel.Env, *cel.Ast, *cel.Issues) { |
| 262 | t.Helper() |
| 263 | policy := parsePolicySource(t, name, policySource) |
| 264 | envOpts = append([]cel.EnvOption{ |
| 265 | cel.OptionalTypes(), |
| 266 | cel.EnableMacroCallTracking(), |
| 267 | ext.Bindings(), |
| 268 | }, envOpts...) |
| 269 | env, err := cel.NewEnv(envOpts...) |
| 270 | if err != nil { |
| 271 | t.Fatalf("cel.NewEnv() failed: %v", err) |
| 272 | } |
| 273 | ast, iss := Compile(env, policy, compilerOpts...) |
| 274 | return env, ast, iss |
| 275 | } |
| 276 | |
| 277 | func newRunner(name, expr string, parseOpts []ParserOption, envOpts ...cel.EnvOption) *runner { |
| 278 | return &runner{ |
no test coverage detected