diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-04 15:44:19 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-05 12:39:17 +0300 |
commit | 8d5f9661e954be91a17d915f214bd14f44622e99 (patch) | |
tree | 25017f6425a3222e014a48dd7a22e752852c99e6 | |
parent | b37e88b3d6128b85586231200c6d1a2f05ecd0d6 (diff) | |
download | luafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.tar.gz luafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.tar.bz2 luafilesystem-8d5f9661e954be91a17d915f214bd14f44622e99.zip |
Test what lfs.attributes returns on error
-rw-r--r-- | tests/test.lua | 5 |
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(".") | |||
136 | io.flush() | 136 | io.flush() |
137 | 137 | ||
138 | -- Trying to get attributes of a non-existent file | 138 | -- Trying to get attributes of a non-existent file |
139 | assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file") | 139 | local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file") |
140 | assert(attr_ok == nil, "could get attributes of a non-existent file") | ||
141 | assert(type(err) == "string", "failed lfs.attributes did not return an error message") | ||
142 | assert(type(errno) == "number", "failed lfs.attributes did not return error code") | ||
140 | assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") | 143 | assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") |
141 | 144 | ||
142 | io.write(".") | 145 | io.write(".") |