aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 10810fe..fd36ba7 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -88,7 +88,9 @@ io.write(".")
88io.flush() 88io.flush()
89 89
90-- Checking link (does not work on Windows) 90-- Checking link (does not work on Windows)
91if lfs.link (tmpfile, "_a_link_for_test_", true) then 91local link_ok = lfs.link (tmpfile, "_a_link_for_test_", true)
92if link_ok then
93 assert (link_ok == true, "successful lfs.link did not return true")
92 assert (lfs.attributes"_a_link_for_test_".mode == "file") 94 assert (lfs.attributes"_a_link_for_test_".mode == "file")
93 assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") 95 assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
94 assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile) 96 assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile)
@@ -152,7 +154,10 @@ io.write(".")
152io.flush() 154io.flush()
153 155
154-- Trying to get attributes of a non-existent file 156-- Trying to get attributes of a non-existent file
155assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file") 157local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file")
158assert(attr_ok == nil, "could get attributes of a non-existent file")
159assert(type(err) == "string", "failed lfs.attributes did not return an error message")
160assert(type(errno) == "number", "failed lfs.attributes did not return error code")
156assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") 161assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory")
157 162
158io.write(".") 163io.write(".")