add memfiles test that closing a closed memFile is ignored (and raises no [OSError])
This commit is contained in:
parent
305766a9fa
commit
7490667578
1 changed files with 13 additions and 0 deletions
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue