From 74906675789624be14083a294e9cdcc766797797 Mon Sep 17 00:00:00 2001 From: JamesP Date: Thu, 24 Sep 2015 09:23:48 +1000 Subject: add memfiles test that closing a closed memFile is ignored (and raises no [OSError]) --- tests/stdlib/tmemfiles1.nim | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/stdlib/tmemfiles1.nim (limited to 'tests/stdlib') 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) -- cgit 1.4.1-2-gfad0