(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…