awaitEval runs ConcurrentEval and returns the result or fails on timeout.
(t *testing.T, prg cel.Program, ctx context.Context, in any)
| 917 | |
| 918 | // awaitEval runs ConcurrentEval and returns the result or fails on timeout. |
| 919 | func awaitEval(t *testing.T, prg cel.Program, ctx context.Context, in any) cel.EvalResult { |
| 920 | t.Helper() |
| 921 | select { |
| 922 | case res := <-prg.ConcurrentEval(ctx, in): |
| 923 | return res |
| 924 | case <-time.After(5 * time.Second): |
| 925 | t.Fatal("ConcurrentEval() timed out") |
| 926 | return cel.EvalResult{} |
| 927 | } |
| 928 | } |
| 929 | |
| 930 | // mustProgram compiles an expression and constructs a Program, separating EnvOptions and ProgramOptions. |
| 931 | func mustProgram(t *testing.T, expr string, opts ...any) cel.Program { |
no test coverage detected