mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 21:44:24 +00:00
test finishes correctly
This commit is contained in:
parent
c1983e1685
commit
f47d9196b1
@ -59,16 +59,16 @@ suite "Switch":
|
|||||||
testProto.init()
|
testProto.init()
|
||||||
testProto.codec = TestCodec
|
testProto.codec = TestCodec
|
||||||
switch1.mount(testProto)
|
switch1.mount(testProto)
|
||||||
asyncCheck switch1.start()
|
var switch1Fut = await switch1.start()
|
||||||
|
|
||||||
(switch2, peerInfo2) = createSwitch(ma2)
|
(switch2, peerInfo2) = createSwitch(ma2)
|
||||||
asyncCheck switch2.start()
|
var switch2Fut = await switch2.start()
|
||||||
let conn = await switch2.dial(peerInfo1, TestCodec)
|
let conn = await switch2.dial(peerInfo1, TestCodec)
|
||||||
await conn.writeLp("Hello!")
|
await conn.writeLp("Hello!")
|
||||||
let msg = cast[string](await conn.readLp())
|
let msg = cast[string](await conn.readLp())
|
||||||
check "Hello!" == msg
|
check "Hello!" == msg
|
||||||
|
|
||||||
# await allFutures(switch1.stop(), switch2.stop())
|
discard allFutures(switch1.stop(), switch2.stop())
|
||||||
result = true
|
result = true
|
||||||
|
|
||||||
check:
|
check:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user