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-05-04 15:44:19 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-05-05 12:39:17 +0300
commit8d5f9661e954be91a17d915f214bd14f44622e99 (patch)
tree25017f6425a3222e014a48dd7a22e752852c99e6
parentb37e88b3d6128b85586231200c6d1a2f05ecd0d6 (diff)
Test what lfs.attributes returns on error
-rw-r--r--tests/test.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test.lua b/tests/test.lua
index abfbd4d..5872717 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -136,7 +136,10 @@ io.write(".")
io.flush()
-- Trying to get attributes of a non-existent file
-assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file")
+local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file")
+assert(attr_ok == nil, "could get attributes of a non-existent file")
+assert(type(err) == "string", "failed lfs.attributes did not return an error message")
+assert(type(errno) == "number", "failed lfs.attributes did not return error code")
assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
io.write(".")