diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.lua | 9 |
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(".") | |||
88 | io.flush() | 88 | io.flush() |
89 | 89 | ||
90 | -- Checking link (does not work on Windows) | 90 | -- Checking link (does not work on Windows) |
91 | if lfs.link (tmpfile, "_a_link_for_test_", true) then | 91 | local link_ok = lfs.link (tmpfile, "_a_link_for_test_", true) |
92 | if 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(".") | |||
152 | io.flush() | 154 | io.flush() |
153 | 155 | ||
154 | -- Trying to get attributes of a non-existent file | 156 | -- Trying to get attributes of a non-existent file |
155 | assert (lfs.attributes ("this couldn't be an actual file") == nil, "could get attributes of a non-existent file") | 157 | local attr_ok, err, errno = lfs.attributes("this couldn't be an actual file") |
158 | assert(attr_ok == nil, "could get attributes of a non-existent file") | ||
159 | assert(type(err) == "string", "failed lfs.attributes did not return an error message") | ||
160 | assert(type(errno) == "number", "failed lfs.attributes did not return error code") | ||
156 | assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") | 161 | assert (type(lfs.attributes (upper)) == "table", "couldn't get attributes of upper directory") |
157 | 162 | ||
158 | io.write(".") | 163 | io.write(".") |