mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 09:34:03 +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())
|
ch := n.Subscribe(context.Background(), blockSent.Key())
|
||||||
|
|
||||||
n.Publish(blockSent)
|
n.Publish(blockSent)
|
||||||
blockRecvd := <-ch
|
blockRecvd, ok := <-ch
|
||||||
|
if !ok {
|
||||||
|
t.Fail()
|
||||||
|
}
|
||||||
|
|
||||||
assertBlocksEqual(t, blockRecvd, blockSent)
|
assertBlocksEqual(t, blockRecvd, blockSent)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCarryOnWhenDeadlineExpires(t *testing.T) {
|
func TestCarryOnWhenDeadlineExpires(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user