Add an attempted reproduction for #5531.

This commit is contained in:
Dominik Picheta 2017-11-26 22:52:39 +00:00
commit 4d931c6276

View file

@ -34,4 +34,19 @@ proc main() {.async.} =
doAssert data == "foot\ntest2" doAssert data == "foot\ntest2"
file.close() file.close()
# Issue #5531
block:
removeFile(fn)
var file = openAsync(fn, fmWrite)
await file.write("test2")
file.close()
file = openAsync(fn, fmWrite)
await file.write("test3")
file.close()
file = openAsync(fn, fmRead)
let data = await file.readAll()
doAssert data == "test3"
file.close()
waitFor main() waitFor main()