Fix broken async tests.
This commit is contained in:
parent
374706b1c3
commit
cdcdab49b7
5 changed files with 7 additions and 7 deletions
|
|
@ -213,5 +213,5 @@ when isMainModule:
|
||||||
"Content-type": "text/plain; charset=utf-8"}
|
"Content-type": "text/plain; charset=utf-8"}
|
||||||
await req.respond(Http200, "Hello World", headers.newStringTable())
|
await req.respond(Http200, "Hello World", headers.newStringTable())
|
||||||
|
|
||||||
server.serve(TPort(5555), cb)
|
asyncCheck server.serve(TPort(5555), cb)
|
||||||
runForever()
|
runForever()
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,7 @@ when isMainModule:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
echo("Got line: ", line)
|
echo("Got line: ", line)
|
||||||
main()
|
asyncCheck main()
|
||||||
elif test == LowClient:
|
elif test == LowClient:
|
||||||
var sock = newAsyncSocket()
|
var sock = newAsyncSocket()
|
||||||
var f = connect(sock, "irc.freenode.net", TPort(6667))
|
var f = connect(sock, "irc.freenode.net", TPort(6667))
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,11 @@ proc createServer(port: TPort) {.async.} =
|
||||||
discard server.TSocketHandle.listen()
|
discard server.TSocketHandle.listen()
|
||||||
while true:
|
while true:
|
||||||
var client = await accept(server)
|
var client = await accept(server)
|
||||||
readMessages(client)
|
asyncCheck readMessages(client)
|
||||||
# TODO: Test: readMessages(disp, await disp.accept(server))
|
# TODO: Test: readMessages(disp, await disp.accept(server))
|
||||||
|
|
||||||
createServer(TPort(10335))
|
asyncCheck createServer(TPort(10335))
|
||||||
launchSwarm(TPort(10335))
|
asyncCheck launchSwarm(TPort(10335))
|
||||||
while true:
|
while true:
|
||||||
poll()
|
poll()
|
||||||
if clientCount == swarmSize: break
|
if clientCount == swarmSize: break
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,4 @@ proc main {.async.} =
|
||||||
discard await g()
|
discard await g()
|
||||||
echo 6
|
echo 6
|
||||||
|
|
||||||
main()
|
asyncCheck main()
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@ proc main {.async.} =
|
||||||
await newAsyncSocket().connect("www.google.com", TPort(80))
|
await newAsyncSocket().connect("www.google.com", TPort(80))
|
||||||
let x = await f()
|
let x = await f()
|
||||||
|
|
||||||
main()
|
asyncCheck main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue