diff options
| author | Reuben Thomas <rrt@sc3d.org> | 2011-06-09 19:49:29 +0100 |
|---|---|---|
| committer | Reuben Thomas <rrt@sc3d.org> | 2011-06-09 19:53:41 +0100 |
| commit | 3cea6c6e9612ca2b04b4742c04721d24f4b316be (patch) | |
| tree | a3ad538475091c20bf9e4766afb6064a72c855fb /tests | |
| parent | 7e979318bd3d237b4fbf8da17b3ece75ac0343ba (diff) | |
| download | luafilesystem-3cea6c6e9612ca2b04b4742c04721d24f4b316be.tar.gz luafilesystem-3cea6c6e9612ca2b04b4742c04721d24f4b316be.tar.bz2 luafilesystem-3cea6c6e9612ca2b04b4742c04721d24f4b316be.zip | |
Add lfs.link.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.lua | 7 |
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)) | |||
| 69 | assert (new_att.access == testdate2, "could not set access time") | 69 | assert (new_att.access == testdate2, "could not set access time") |
| 70 | assert (new_att.modification == testdate1, "could not set modification time") | 70 | assert (new_att.modification == testdate1, "could not set modification time") |
| 71 | 71 | ||
| 72 | -- Checking symbolic link information (does not work in Windows) | 72 | -- Checking link (does not work on Windows) |
| 73 | if (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) then | 73 | if lfs.link (tmpfile, "_a_link_for_test_", true) then |
| 74 | assert (lfs.attributes"_a_link_for_test_".mode == "file") | 74 | assert (lfs.attributes"_a_link_for_test_".mode == "file") |
| 75 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") | 75 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") |
| 76 | assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) | ||
| 77 | assert (lfs.attributes (tmpfile, "nlink") == 2) | ||
| 76 | assert (os.remove"_a_link_for_test_") | 78 | assert (os.remove"_a_link_for_test_") |
| 79 | assert (os.remove"_a_hard_link_for_test_") | ||
| 77 | end | 80 | end |
| 78 | 81 | ||
| 79 | -- Checking text/binary modes (only has an effect in Windows) | 82 | -- Checking text/binary modes (only has an effect in Windows) |
