Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keplerproject/luafilesystem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2011-06-09 22:49:29 +0400
committerReuben Thomas <rrt@sc3d.org>2011-06-09 22:53:41 +0400
commit3cea6c6e9612ca2b04b4742c04721d24f4b316be (patch)
treea3ad538475091c20bf9e4766afb6064a72c855fb /tests
parent7e979318bd3d237b4fbf8da17b3ece75ac0343ba (diff)
Add lfs.link.
Diffstat (limited to 'tests')
-rw-r--r--tests/test.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 81a0ab6..c4911c9 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -69,11 +69,14 @@ local new_att = assert (lfs.attributes (tmpfile))
assert (new_att.access == testdate2, "could not set access time")
assert (new_att.modification == testdate1, "could not set modification time")
--- Checking symbolic link information (does not work in Windows)
-if (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) then
+-- Checking link (does not work on Windows)
+if lfs.link (tmpfile, "_a_link_for_test_", true) then
assert (lfs.attributes"_a_link_for_test_".mode == "file")
assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link")
+ assert (lfs.link (tmpfile, "_a_hard_link_for_test_"))
+ assert (lfs.attributes (tmpfile, "nlink") == 2)
assert (os.remove"_a_link_for_test_")
+ assert (os.remove"_a_hard_link_for_test_")
end
-- Checking text/binary modes (only has an effect in Windows)