Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keplerproject/luafilesystem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-06-09 13:28:56 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-06-09 13:28:56 +0300
commit7fae11cdb5a129ce798df462365b7ce60c5f4d62 (patch)
tree217d9e470c9ae75bcc105fbbbaed0c2dcb9ab8de
parent6e0dc7b27ce6e8a56d646071b69d7e46c85dd245 (diff)
Add a test for #52.
-rw-r--r--tests/test.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua
index abfbd4d..2842bc0 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -107,6 +107,9 @@ assert(result) -- on non-Windows platforms, mode is always returned as "binary"
result, mode = lfs.setmode(f, "text")
assert(result and mode == "binary")
f:close()
+local ok, err = pcall(lfs.setmode, f, "binary")
+assert(not ok, "could setmode on closed file")
+assert(err:find("closed file"), "bad error message for setmode on closed file")
io.write(".")
io.flush()