(t *testing.T)
| 27 | } |
| 28 | |
| 29 | func TestLatchRelease(t *testing.T) { |
| 30 | latch := asyncbuffer.NewLatch() |
| 31 | |
| 32 | // Release the latch |
| 33 | latch.Release() |
| 34 | |
| 35 | // Channel should now be closed/ready |
| 36 | select { |
| 37 | case <-asyncbuffer.LatchDone(latch): |
| 38 | // Expected - channel is ready after release |
| 39 | default: |
| 40 | t.Fatal("Latch should be released after Release() call") |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestLatchWait(t *testing.T) { |
| 45 | latch := asyncbuffer.NewLatch() |