From 5dbed426c269cd23323765aab9efecae01ac8d14 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Fri, 13 Nov 2020 12:24:23 +0100 Subject: [PATCH] failing test --- tests/testmplex.nim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/testmplex.nim b/tests/testmplex.nim index cb12d5cc5..e0c47e108 100644 --- a/tests/testmplex.nim +++ b/tests/testmplex.nim @@ -235,6 +235,22 @@ suite "Mplex": check await allFutures(rfut, wfut, wfut2).withTimeout(100.millis) await conn.close() + asyncTest "should complete both read and push 2": + proc writeHandler(data: seq[byte]) {.async, gcsafe.} = discard + let + conn = newBufferStream(writeHandler) + chann = LPChannel.init(1, conn, true) + + var data = newSeq[byte](1) + let rfut = chann.readExactly(addr data[0], 1) + rfut.cancel() + + let wfut = chann.pushData(@[0'u8]) + let wfut2 = chann.pushData(@[0'u8]) + await chann.reset() + check await allFutures(rfut, wfut, wfut2).withTimeout(100.millis) + await conn.close() + asyncTest "channel should fail writing": proc writeHandler(data: seq[byte]) {.async, gcsafe.} = discard let