(t *testing.T, name string, ch Channel)
| 7 | ) |
| 8 | |
| 9 | func testChannel(t *testing.T, name string, ch Channel) { |
| 10 | go func() { |
| 11 | for i := 0; i < 1000; i++ { |
| 12 | ch.In() <- i |
| 13 | } |
| 14 | ch.Close() |
| 15 | }() |
| 16 | for i := 0; i < 1000; i++ { |
| 17 | val := <-ch.Out() |
| 18 | if i != val.(int) { |
| 19 | t.Fatal(name, "expected", i, "but got", val.(int)) |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | func testChannelPair(t *testing.T, name string, in InChannel, out OutChannel) { |
| 25 | go func() { |
no test coverage detected
searching dependent graphs…