readding commented out tests
This commit is contained in:
parent
2066e81658
commit
f9f75254af
|
@ -67,53 +67,53 @@ proc subscribeNodes*(nodes: seq[Switch]) {.async.} =
|
||||||
await allFutures(pending)
|
await allFutures(pending)
|
||||||
|
|
||||||
suite "PubSub":
|
suite "PubSub":
|
||||||
# test "FloodSub basic publish/subscribe A -> B":
|
test "FloodSub basic publish/subscribe A -> B":
|
||||||
# proc testBasicPubSub(): Future[bool] {.async.} =
|
proc testBasicPubSub(): Future[bool] {.async.} =
|
||||||
# var passed: bool
|
var passed: bool
|
||||||
# proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
||||||
# check topic == "foobar"
|
check topic == "foobar"
|
||||||
# passed = true
|
passed = true
|
||||||
|
|
||||||
# var nodes = generateNodes(2)
|
var nodes = generateNodes(2)
|
||||||
# var wait = await nodes[1].start()
|
var wait = await nodes[1].start()
|
||||||
|
|
||||||
# await nodes[0].subscribeToPeer(nodes[1].peerInfo)
|
await nodes[0].subscribeToPeer(nodes[1].peerInfo)
|
||||||
|
|
||||||
# await nodes[1].subscribe("foobar", handler)
|
await nodes[1].subscribe("foobar", handler)
|
||||||
# await sleepAsync(100.millis)
|
await sleepAsync(100.millis)
|
||||||
|
|
||||||
# await nodes[0].publish("foobar", cast[seq[byte]]("Hello!"))
|
await nodes[0].publish("foobar", cast[seq[byte]]("Hello!"))
|
||||||
# await sleepAsync(100.millis)
|
await sleepAsync(100.millis)
|
||||||
|
|
||||||
# await nodes[1].stop()
|
await nodes[1].stop()
|
||||||
# await allFutures(wait)
|
await allFutures(wait)
|
||||||
# result = passed
|
result = passed
|
||||||
|
|
||||||
# check:
|
check:
|
||||||
# waitFor(testBasicPubSub()) == true
|
waitFor(testBasicPubSub()) == true
|
||||||
|
|
||||||
# test "FloodSub basic publish/subscribe B -> A":
|
test "FloodSub basic publish/subscribe B -> A":
|
||||||
# proc testBasicPubSub(): Future[bool] {.async.} =
|
proc testBasicPubSub(): Future[bool] {.async.} =
|
||||||
# proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
|
||||||
# check topic == "foobar"
|
check topic == "foobar"
|
||||||
|
|
||||||
# var nodes = generateNodes(2)
|
var nodes = generateNodes(2)
|
||||||
# var wait = await nodes[1].start()
|
var wait = await nodes[1].start()
|
||||||
|
|
||||||
# await nodes[0].subscribeToPeer(nodes[1].peerInfo)
|
await nodes[0].subscribeToPeer(nodes[1].peerInfo)
|
||||||
|
|
||||||
# await nodes[0].subscribe("foobar", handler)
|
await nodes[0].subscribe("foobar", handler)
|
||||||
# await sleepAsync(10.millis)
|
await sleepAsync(10.millis)
|
||||||
|
|
||||||
# await nodes[1].publish("foobar", cast[seq[byte]]("Hello!"))
|
await nodes[1].publish("foobar", cast[seq[byte]]("Hello!"))
|
||||||
# await sleepAsync(10.millis)
|
await sleepAsync(10.millis)
|
||||||
|
|
||||||
# await nodes[1].stop()
|
await nodes[1].stop()
|
||||||
# await allFutures(wait)
|
await allFutures(wait)
|
||||||
# result = true
|
result = true
|
||||||
|
|
||||||
# check:
|
check:
|
||||||
# waitFor(testBasicPubSub()) == true
|
waitFor(testBasicPubSub()) == true
|
||||||
|
|
||||||
test "FloodSub multiple peers, no self trigger":
|
test "FloodSub multiple peers, no self trigger":
|
||||||
proc testBasicFloodSub(): Future[bool] {.async.} =
|
proc testBasicFloodSub(): Future[bool] {.async.} =
|
||||||
|
|
Loading…
Reference in New Issue