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

Function testChannel

channels_test.go:9–22  ·  view source on GitHub ↗
(t *testing.T, name string, ch Channel)

Source from the content-addressed store, hash-verified

7)
8
9func 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
24func testChannelPair(t *testing.T, name string, in InChannel, out OutChannel) {
25 go func() {

Callers 5

TestOverflowingChannelFunction · 0.85
TestRingChannelFunction · 0.85
TestNativeChannelsFunction · 0.85
TestResizableChannelFunction · 0.85
TestInfiniteChannelFunction · 0.85

Calls 3

InMethod · 0.65
CloseMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…