newTestFrame creates an ExecutionFrame with an evaluation context attached.
(t *testing.T, ctx context.Context)
| 51 | |
| 52 | // newTestFrame creates an ExecutionFrame with an evaluation context attached. |
| 53 | func newTestFrame(t *testing.T, ctx context.Context) (*ExecutionFrame, func()) { |
| 54 | t.Helper() |
| 55 | frame, err := NewExecutionFrame(EmptyActivation()) |
| 56 | if err != nil { |
| 57 | t.Fatalf("NewExecutionFrame() failed: %v", err) |
| 58 | } |
| 59 | if err := frame.SetContext(ctx, 0); err != nil { |
| 60 | t.Fatalf("SetContext() failed: %v", err) |
| 61 | } |
| 62 | return frame, frame.Close |
| 63 | } |
| 64 | |
| 65 | // awaitResult re-evaluates ComputeResult until it returns a non-Unknown value or the deadline fires. |
| 66 | func awaitResult(t *testing.T, frame *ExecutionFrame, completions <-chan int64, id int64, fn, overload string, impl functions.AsyncOp, args ...ref.Val) ref.Val { |
no test coverage detected