mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 03:53:06 +00:00
Add a test for success return value of lfs.link
This commit is contained in:
@@ -88,7 +88,9 @@ io.write(".")
|
|||||||
io.flush()
|
io.flush()
|
||||||
|
|
||||||
-- Checking link (does not work on Windows)
|
-- Checking link (does not work on Windows)
|
||||||
if lfs.link (tmpfile, "_a_link_for_test_", true) then
|
local link_ok = lfs.link (tmpfile, "_a_link_for_test_", true)
|
||||||
|
if link_ok then
|
||||||
|
assert (link_ok == true, "successful lfs.link did not return true")
|
||||||
assert (lfs.attributes"_a_link_for_test_".mode == "file")
|
assert (lfs.attributes"_a_link_for_test_".mode == "file")
|
||||||
assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
|
assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
|
||||||
assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
|
assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
|
||||||
|
|||||||
Reference in New Issue
Block a user