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:
authorcarregal <carregal>2008-02-13 23:59:51 +0300
committercarregal <carregal>2008-02-13 23:59:51 +0300
commitdb7e8b913315e269afde7bd20b54cbc9514a5f9d (patch)
treea98e1ce03bc5fa7ff7cf86bc6282121dbb0e37a5 /tests
parentd931b9b2bb50bd8316393a6dbdf7b845a2b5e1ef (diff)
Adding tests for lfs.setmode
Diffstat (limited to 'tests')
-rw-r--r--tests/test.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua
index d47a062..4c09020 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -77,6 +77,16 @@ if lfs.symlinkattributes then
assert (os.remove"_a_link_for_test_")
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
assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
new_att = assert (lfs.attributes (tmpfile))