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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user