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

Function TestNewLatch

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

Source from the content-addressed store, hash-verified

12)
13
14func TestNewLatch(t *testing.T) {
15 latch := asyncbuffer.NewLatch()
16
17 require.NotNil(t, latch)
18 require.NotNil(t, asyncbuffer.LatchDone(latch))
19
20 // Channel should be open (not closed) initially
21 select {
22 case <-asyncbuffer.LatchDone(latch):
23 t.Fatal("Latch should not be released initially")
24 default:
25 // Expected - channel is not ready
26 }
27}
28
29func TestLatchRelease(t *testing.T) {
30 latch := asyncbuffer.NewLatch()

Callers

nothing calls this directly

Calls 2

NewLatchFunction · 0.92
LatchDoneFunction · 0.92

Tested by

no test coverage detected