Skip to content

Commit

Permalink
set isEof flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Jul 29, 2020
1 parent 73f6fe2 commit 09e2c2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/testmultistream.nim
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ method write*(s: TestSelectStream, msg: seq[byte]) {.async, gcsafe.} = discard

method close(s: TestSelectStream) {.async, gcsafe.} =
s.isClosed = true
s.isEof = true

proc newTestSelectStream(): TestSelectStream =
new result
Expand Down Expand Up @@ -104,6 +105,7 @@ method write*(s: TestLsStream, msg: seq[byte]) {.async, gcsafe.} =

method close(s: TestLsStream) {.async, gcsafe.} =
s.isClosed = true
s.isEof = true

proc newTestLsStream(ls: LsHandler): TestLsStream {.gcsafe.} =
new result
Expand Down Expand Up @@ -157,6 +159,7 @@ method write*(s: TestNaStream, msg: seq[byte]) {.async, gcsafe.} =

method close(s: TestNaStream) {.async, gcsafe.} =
s.isClosed = true
s.isEof = true

proc newTestNaStream(na: NaHandler): TestNaStream =
new result
Expand Down Expand Up @@ -234,6 +237,7 @@ suite "Multistream select":
let conn = newTestNaStream(testNaHandler)

proc testNaHandler(msg: string): Future[void] {.async, gcsafe.} =
echo msg
check msg == Na
await conn.close()

Expand Down

0 comments on commit 09e2c2a

Please sign in to comment.