aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 882838b..1fd6157 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -69,7 +69,8 @@ local new_att = assert (lfs.attributes (tmpfile))
69assert (new_att.access == testdate2, "could not set access time") 69assert (new_att.access == testdate2, "could not set access time")
70assert (new_att.modification == testdate1, "could not set modification time") 70assert (new_att.modification == testdate1, "could not set modification time")
71 71
72if lfs.symlinkattributes then 72local res, err = lfs.symlinkattributes(tmpfile)
73if err ~= "symlinkattributes not supported on this platform" then
73 -- Checking symbolic link information (does not work in Windows) 74 -- Checking symbolic link information (does not work in Windows)
74 assert (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) 75 assert (os.execute ("ln -s "..tmpfile.." _a_link_for_test_"))
75 assert (lfs.attributes"_a_link_for_test_".mode == "file") 76 assert (lfs.attributes"_a_link_for_test_".mode == "file")
@@ -81,9 +82,9 @@ if lfs.setmode then
81 -- Checking text/binary modes (works only in Windows) 82 -- Checking text/binary modes (works only in Windows)
82 local f = io.open(tmpfile, "w") 83 local f = io.open(tmpfile, "w")
83 local result, mode = lfs.setmode(f, "binary") 84 local result, mode = lfs.setmode(f, "binary")
84 assert(result and mode == "text") 85 assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform"))
85 result, mode = lfs.setmode(f, "text") 86 result, mode = lfs.setmode(f, "text")
86 assert(result and mode == "binary") 87 assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform"))
87 f:close() 88 f:close()
88end 89end
89 90