summary refs log tree commit diff stats
path: root/tests/async/tasyncfilewrite.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-05-16 15:43:09 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-05-16 15:43:09 +0200
commitc3c37dbb1574db5078b86be29804990d153ec1c1 (patch)
tree7c042f1163b6c10910070599dc55f9c14341236e /tests/async/tasyncfilewrite.nim
parent2d91c04f4eea1f0768b305b4903b4c455b9d06e8 (diff)
parent224eec595a6112c7aa3a4c06afacc99167580464 (diff)
downloadNim-c3c37dbb1574db5078b86be29804990d153ec1c1.tar.gz
Merge branch 'devel' into araq
Diffstat (limited to 'tests/async/tasyncfilewrite.nim')
-rw-r--r--tests/async/tasyncfilewrite.nim17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/async/tasyncfilewrite.nim b/tests/async/tasyncfilewrite.nim
new file mode 100644
index 000000000..cda612bae
--- /dev/null
+++ b/tests/async/tasyncfilewrite.nim
@@ -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")
+