aboutsummaryrefslogtreecommitdiff
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)
downloadluafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.tar.gz
luafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.tar.bz2
luafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.zip
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(".")
136io.flush() 136io.flush()
137 137
138-- Trying to get attributes of a non-existent file 138-- Trying to get attributes of a non-existent file
139assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file") 139local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file")
140assert(attr_ok == nil, "could get attributes of a non-existent file")
141assert(type(err) == "string", "failed lfs.attributes did not return an error message")
142assert(type(errno) == "number", "failed lfs.attributes did not return error code")
140assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") 143assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
141 144
142io.write(".") 145io.write(".")