summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-05-14 17:10:39 +0200
committerGitHub <noreply@github.com>2017-05-14 17:10:39 +0200
commit3afd852f54df2a0bc06be34d06509dfb2b9c80c5 (patch)
treebaa4d2eba0f88403376cfaab6c4763d61934c583 /tests
parentec50dab57d91fb33380a39479bafbeae48ed1a83 (diff)
downloadNim-3afd852f54df2a0bc06be34d06509dfb2b9c80c5.tar.gz
Fixes #5532 win async write (#5791)
* nimgrab tool bugfix: don't divide by zero
* fixes #5532 (asyncfile write on Windows)
* add a comment about what has been tried instead
Diffstat (limited to 'tests')
-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")
+