@cryptotaxi247 / kubo / commits / a5fccacce

tests(bitswap/notifications) test niladic

License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Brian Tiger Chow committed Nov 21, 2014 at 17:21 UTC a5fccaccee4f5dbbc505be79624d24028697db5f
1 file changed +9
exchange/bitswap/notifications/notifications_test.go
+9
@@ -49,6 +49,15 @@ func TestSubscribeMany(t *testing.T) {
49 assertBlocksEqual(t, e2, r2)
50 }
51
52 +func TestSubscribeIsANoopWhenCalledWithNoKeys(t *testing.T) {
53 + n := New()
54 + defer n.Shutdown()
55 + ch := n.Subscribe(context.TODO()) // no keys provided
56 + if _, ok := <-ch; ok {
57 + t.Fatal("should be closed if no keys provided")
58 + }
59 +}
60 +
61 func TestCarryOnWhenDeadlineExpires(t *testing.T) {
62
63 impossibleDeadline := time.Nanosecond