mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-08 21:04:20 +00:00
add memfiles test that closing a closed memFile is ignored (and raises no [OSError])
This commit is contained in:
13
tests/stdlib/tmemfiles1.nim
Normal file
13
tests/stdlib/tmemfiles1.nim
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user