(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestComputeResultResolves(t *testing.T) { |
| 105 | ctx, cancel := context.WithCancel(context.Background()) |
| 106 | defer cancel() |
| 107 | frame, closeFrame := newTestFrame(t, ctx) |
| 108 | defer closeFrame() |
| 109 | |
| 110 | completions := make(chan int64, 1) |
| 111 | if err := frame.SetCompletions(completions); err != nil { |
| 112 | t.Fatalf("SetCompletions() failed: %v", err) |
| 113 | } |
| 114 | |
| 115 | var calls atomic.Int32 |
| 116 | impl := asyncReturning(types.Int(42), &calls) |
| 117 | res := awaitResult(t, frame, completions, 1, "fn", "fn_int", impl, types.Int(1)) |
| 118 | if res.Equal(types.Int(42)) != types.True { |
| 119 | t.Errorf("async result = %v, wanted 42", res) |
| 120 | } |
| 121 | if got := calls.Load(); got != 1 { |
| 122 | t.Errorf("impl invoked %d times, wanted exactly 1", got) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | func TestTrackerDedupAndCallIDs(t *testing.T) { |
| 127 | // Exercise the tracker directly to keep bookkeeping assertions isolated from the |
nothing calls this directly
no test coverage detected