MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / TestLatchRelease

Function TestLatchRelease

asyncbuffer/latch_test.go:29–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func 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
44func TestLatchWait(t *testing.T) {
45 latch := asyncbuffer.NewLatch()

Callers

nothing calls this directly

Calls 3

ReleaseMethod · 0.95
NewLatchFunction · 0.92
LatchDoneFunction · 0.92

Tested by

no test coverage detected