mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
make async test more reliable
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user