summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorJamesP <jlp765@gmail.com>2015-09-24 09:23:48 +1000
committerJamesP <jlp765@gmail.com>2015-09-24 09:23:48 +1000
commit74906675789624be14083a294e9cdcc766797797 (patch)
tree66a1e715a16df216a142c2ee8298cc8d0a4017b2 /tests/stdlib
parent305766a9fa079cbb96e8a80b3531b4c656a5e040 (diff)
downloadNim-74906675789624be14083a294e9cdcc766797797.tar.gz
add memfiles test that closing a closed memFile is ignored (and raises no [OSError])
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tmemfiles1.nim13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/stdlib/tmemfiles1.nim b/tests/stdlib/tmemfiles1.nim
new file mode 100644
index 000000000..282b45423
--- /dev/null
+++ b/tests/stdlib/tmemfiles1.nim
@@ -0,0 +1,13 @@
+discard """
+test that closing a closed file is ignored (no error raised)
+output: nothing
+"""
+import memfiles, os
+var
+  mm: MemFile
+  fn = "test.mmap"
+# Create a new file
+mm = memfiles.open(fn, mode = fmReadWrite, newFileSize = 20)
+mm.close()
+mm.close()
+if fileExists(fn): removeFile(fn)