(t *testing.T)
| 504 | } |
| 505 | |
| 506 | func TestContextEvalRejectsAsync(t *testing.T) { |
| 507 | prg := mustProgram(t, `rpc("a")`, |
| 508 | cel.Function("rpc", |
| 509 | cel.Overload("rpc_string", []*cel.Type{cel.StringType}, cel.StringType, |
| 510 | cel.AsyncBinding(func(ctx context.Context, args ...ref.Val) ref.Val { return args[0] }))), |
| 511 | ) |
| 512 | _, _, err := prg.ContextEval(context.Background(), cel.NoVars()) |
| 513 | if err == nil || !strings.Contains(err.Error(), "ConcurrentEval") { |
| 514 | t.Errorf("ContextEval() on async expr = %v, want error mentioning ConcurrentEval", err) |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | func TestEvalRejectsAsync(t *testing.T) { |
| 519 | prg := mustProgram(t, `rpc("a")`, |
nothing calls this directly
no test coverage detected