mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 23:35:22 +00:00
* nimgrab tool bugfix: don't divide by zero * fixes #5532 (asyncfile write on Windows) * add a comment about what has been tried instead
This commit is contained in:
17
tests/async/tasyncfilewrite.nim
Normal file
17
tests/async/tasyncfilewrite.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
discard """
|
||||
output: '''string 1
|
||||
string 2
|
||||
string 3'''
|
||||
"""
|
||||
# bug #5532
|
||||
import os, asyncfile, asyncdispatch
|
||||
|
||||
removeFile("test.txt")
|
||||
let f = openAsync("test.txt", 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")
|
||||
|
||||
Reference in New Issue
Block a user