aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test.lua16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 133bac2..6eb9f70 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -76,15 +76,13 @@ if (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) then
76 assert (os.remove"_a_link_for_test_") 76 assert (os.remove"_a_link_for_test_")
77end 77end
78 78
79if lfs.setmode then 79-- Checking text/binary modes (only has an effect in Windows)
80 -- Checking text/binary modes (works only in Windows) 80local f = io.open(tmpfile, "w")
81 local f = io.open(tmpfile, "w") 81local result, mode = lfs.setmode(f, "binary")
82 local result, mode = lfs.setmode(f, "binary") 82assert(result) -- on non-Windows platforms, mode is always returned as "binary"
83 assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform")) 83result, mode = lfs.setmode(f, "text")
84 result, mode = lfs.setmode(f, "text") 84assert(result and mode == "binary")
85 assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform")) 85f:close()
86 f:close()
87end
88 86
89-- Restore access time to current value 87-- Restore access time to current value
90assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) 88assert (lfs.touch (tmpfile, attrib.access, attrib.modification))