summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
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)