(t testing.TB, name string, policySource string, parseOpts ...ParserOption)
| 245 | } |
| 246 | |
| 247 | func parsePolicySource(t testing.TB, name string, policySource string, parseOpts ...ParserOption) *Policy { |
| 248 | t.Helper() |
| 249 | p := StringSource(policySource, name) |
| 250 | parser, err := NewParser(parseOpts...) |
| 251 | if err != nil { |
| 252 | t.Fatalf("NewParser() failed: %v", err) |
| 253 | } |
| 254 | policy, iss := parser.Parse(p) |
| 255 | if iss.Err() != nil { |
| 256 | t.Fatalf("parser.Parse() failed: %v", iss.Err()) |
| 257 | } |
| 258 | return policy |
| 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() |
no test coverage detected