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

Function testChannelPair

channels_test.go:24–37  ·  view source on GitHub ↗
(t *testing.T, name string, in InChannel, out OutChannel)

Source from the content-addressed store, hash-verified

22}
23
24func testChannelPair(t *testing.T, name string, in InChannel, out OutChannel) {
25 go func() {
26 for i := 0; i < 1000; i++ {
27 in.In() <- i
28 }
29 in.Close()
30 }()
31 for i := 0; i < 1000; i++ {
32 val := <-out.Out()
33 if i != val.(int) {
34 t.Fatal("pair", name, "expected", i, "but got", val.(int))
35 }
36 }
37}
38
39func testChannelConcurrentAccessors(t *testing.T, name string, ch Channel) {
40 // no asserts here, this is just for the race detector's benefit

Callers 8

TestNativeChannelsFunction · 0.85
TestResizableChannelFunction · 0.85
TestInfiniteChannelFunction · 0.85
TestPipeFunction · 0.85
TestWeakPipeFunction · 0.85
testMultiplexFunction · 0.85
testTeeFunction · 0.85
testDistributeFunction · 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…