1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-29 01:12:24 +08:00

test(bitswap:notifications) check if chan is open

This commit is contained in:
Brian Tiger Chow
2014-09-12 03:28:11 -07:00
parent a7ef09554f
commit 2f4175a00d

View File

@ -18,9 +18,13 @@ func TestPublishSubscribe(t *testing.T) {
ch := n.Subscribe(context.Background(), blockSent.Key())
n.Publish(blockSent)
blockRecvd := <-ch
blockRecvd, ok := <-ch
if !ok {
t.Fail()
}
assertBlocksEqual(t, blockRecvd, blockSent)
}
func TestCarryOnWhenDeadlineExpires(t *testing.T) {