tests(bitswap/notifications) test niladic

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow 2014-11-21 17:21:03 -08:00 committed by Jeromy
parent 03324f7765
commit a5fccaccee

View File

@ -49,6 +49,15 @@ func TestSubscribeMany(t *testing.T) {
assertBlocksEqual(t, e2, r2)
}
func TestSubscribeIsANoopWhenCalledWithNoKeys(t *testing.T) {
n := New()
defer n.Shutdown()
ch := n.Subscribe(context.TODO()) // no keys provided
if _, ok := <-ch; ok {
t.Fatal("should be closed if no keys provided")
}
}
func TestCarryOnWhenDeadlineExpires(t *testing.T) {
impossibleDeadline := time.Nanosecond