From 1611d2b1c08dd351784ed1c2549b7aba5dc6ec8a Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Tue, 3 Sep 2019 19:43:57 -0600 Subject: [PATCH] readding missed tests --- tests/testmplex.nim | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/testmplex.nim b/tests/testmplex.nim index a4d4f53c4..ed0d8cf62 100644 --- a/tests/testmplex.nim +++ b/tests/testmplex.nim @@ -37,31 +37,31 @@ proc newTestDecodeStream(): TestDecodeStream = result.msg = fromHex("8801023137") suite "Mplex": - # test "encode header": - # proc testEncodeHeader(): Future[bool] {.async.} = - # proc encHandler(msg: seq[byte]) = - # check msg == fromHex("880102") + test "encode header": + proc testEncodeHeader(): Future[bool] {.async.} = + proc encHandler(msg: seq[byte]) = + check msg == fromHex("880102") - # let conn = newConnection(newTestEncodeStream(encHandler)) - # await conn.writeHeader(17, MessageType.New, 2) - # result = true + let conn = newConnection(newTestEncodeStream(encHandler)) + await conn.writeHeader(17, MessageType.New, 2) + result = true - # check: - # waitFor(testEncodeHeader()) == true + check: + waitFor(testEncodeHeader()) == true - # test "decode header": - # proc testDecodeHeader(): Future[bool] {.async.} = - # let conn = newConnection(newTestDecodeStream()) - # let (id, msgType) = await conn.readHeader() + test "decode header": + proc testDecodeHeader(): Future[bool] {.async.} = + let conn = newConnection(newTestDecodeStream()) + let (id, msgType) = await conn.readHeader() - # check id == 17 - # check msgType == MessageType.New - # let data = await conn.readLp() - # check cast[string](data) == "17" - # result = true + check id == 17 + check msgType == MessageType.New + let data = await conn.readLp() + check cast[string](data) == "17" + result = true - # check: - # waitFor(testDecodeHeader()) == true + check: + waitFor(testDecodeHeader()) == true test "e2e - read/write initiator": proc testNewStream(): Future[bool] {.async.} =