(t *testing.T)
| 113 | } |
| 114 | |
| 115 | func TestLatchMultipleReleases(t *testing.T) { |
| 116 | latch := asyncbuffer.NewLatch() |
| 117 | |
| 118 | // Release multiple times should be safe |
| 119 | latch.Release() |
| 120 | latch.Release() |
| 121 | latch.Release() |
| 122 | |
| 123 | // Should still be able to wait |
| 124 | select { |
| 125 | case <-asyncbuffer.LatchDone(latch): |
| 126 | // Expected - channel should be ready |
| 127 | default: |
| 128 | t.Fatal("Latch should be released") |
| 129 | } |
| 130 | } |