mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 12:23:08 +00:00
Adding tests for lfs.setmode
This commit is contained in:
@@ -77,6 +77,16 @@ if lfs.symlinkattributes then
|
|||||||
assert (os.remove"_a_link_for_test_")
|
assert (os.remove"_a_link_for_test_")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if lfs.setmode then
|
||||||
|
-- Checking text/binary modes (works only in Windows)
|
||||||
|
local f = io.open(tmpfile, "w")
|
||||||
|
local mode = lfs.setmode(f, "binary")
|
||||||
|
assert(mode == "text")
|
||||||
|
mode = lfs.setmode(f, "text")
|
||||||
|
assert(mode == "binary")
|
||||||
|
f:close()
|
||||||
|
end
|
||||||
|
|
||||||
-- Restore access time to current value
|
-- Restore access time to current value
|
||||||
assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
|
assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
|
||||||
new_att = assert (lfs.attributes (tmpfile))
|
new_att = assert (lfs.attributes (tmpfile))
|
||||||
|
|||||||
Reference in New Issue
Block a user