(t *testing.T)
| 516 | } |
| 517 | |
| 518 | func TestEvalRejectsAsync(t *testing.T) { |
| 519 | prg := mustProgram(t, `rpc("a")`, |
| 520 | cel.Function("rpc", |
| 521 | cel.Overload("rpc_string", []*cel.Type{cel.StringType}, cel.StringType, |
| 522 | cel.AsyncBinding(func(ctx context.Context, args ...ref.Val) ref.Val { return args[0] }))), |
| 523 | ) |
| 524 | _, _, err := prg.Eval(cel.NoVars()) |
| 525 | if err == nil || !strings.Contains(err.Error(), "ConcurrentEval") { |
| 526 | t.Errorf("Eval() on async expr = %v, want error mentioning ConcurrentEval", err) |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | func TestContextEvalAllowsPartialUnknown(t *testing.T) { |
| 531 | // A variable unknown from partial evaluation must NOT be mistaken for an async call. |
nothing calls this directly
no test coverage detected