make async test more reliable
This commit is contained in:
parent
e4902a4a35
commit
4c34787107
1 changed files with 5 additions and 3 deletions
|
|
@ -6,12 +6,14 @@ string 3'''
|
|||
# bug #5532
|
||||
import os, asyncfile, asyncdispatch
|
||||
|
||||
removeFile("test.txt")
|
||||
let f = openAsync("test.txt", fmWrite)
|
||||
const F = "test_async.txt"
|
||||
|
||||
removeFile(F)
|
||||
let f = openAsync(F, fmWrite)
|
||||
var futs = newSeq[Future[void]]()
|
||||
for i in 1..3:
|
||||
futs.add(f.write("string " & $i & "\n"))
|
||||
waitFor(all(futs))
|
||||
f.close()
|
||||
echo readFile("test.txt")
|
||||
echo readFile(F)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue