MCPcopy Create free account
hub / github.com/eapache/channels / TestDeadChannel

Function TestDeadChannel

native_channel_test.go:32–58  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestDeadChannel(t *testing.T) {
33 ch := NewDeadChannel()
34
35 if ch.Len() != 0 {
36 t.Error("dead channel length not 0")
37 }
38 if ch.Cap() != 0 {
39 t.Error("dead channel cap not 0")
40 }
41
42 select {
43 case <-ch.Out():
44 t.Error("read from a dead channel")
45 default:
46 }
47
48 select {
49 case ch.In() <- nil:
50 t.Error("wrote to a dead channel")
51 default:
52 }
53
54 ch.Close()
55
56 ch = NewDeadChannel()
57 testChannelConcurrentAccessors(t, "dead channel", ch)
58}

Callers

nothing calls this directly

Calls 7

LenMethod · 0.95
CapMethod · 0.95
OutMethod · 0.95
InMethod · 0.95
CloseMethod · 0.95
NewDeadChannelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…