mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-05 16:28:06 +08:00
test(notifications)
we expect this to fail. will be fixed in upcoming commit License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
9120d107c3
commit
d5e7fd6707
@ -26,6 +26,29 @@ func TestPublishSubscribe(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
func TestSubscribeMany(t *testing.T) {
|
||||
e1 := blocks.NewBlock([]byte("Greetings from The Interval"))
|
||||
e2 := blocks.NewBlock([]byte("Greetings from The Interval"))
|
||||
|
||||
n := New()
|
||||
defer n.Shutdown()
|
||||
ch := n.Subscribe(context.Background(), e1.Key(), e2.Key())
|
||||
|
||||
n.Publish(e1)
|
||||
r1, ok := <-ch
|
||||
if !ok {
|
||||
t.Fatal("didn't receive first expected block")
|
||||
}
|
||||
assertBlocksEqual(t, e1, r1)
|
||||
|
||||
n.Publish(e2)
|
||||
r2, ok := <-ch
|
||||
if !ok {
|
||||
t.Fatal("didn't receive second expected block")
|
||||
}
|
||||
assertBlocksEqual(t, e2, r2)
|
||||
}
|
||||
|
||||
func TestCarryOnWhenDeadlineExpires(t *testing.T) {
|
||||
|
||||
impossibleDeadline := time.Nanosecond
|
||||
|
||||
Loading…
Reference in New Issue
Block a user