aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorcarregal <carregal>2008-02-13 20:59:51 +0000
committercarregal <carregal>2008-02-13 20:59:51 +0000
commitdb7e8b913315e269afde7bd20b54cbc9514a5f9d (patch)
treea98e1ce03bc5fa7ff7cf86bc6282121dbb0e37a5 /tests
parentd931b9b2bb50bd8316393a6dbdf7b845a2b5e1ef (diff)
downloadluafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.tar.gz
luafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.tar.bz2
luafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.zip
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
77 assert (os.remove"_a_link_for_test_") 77 assert (os.remove"_a_link_for_test_")
78end 78end
79 79
80if lfs.setmode then
81 -- Checking text/binary modes (works only in Windows)
82 local f = io.open(tmpfile, "w")
83 local mode = lfs.setmode(f, "binary")
84 assert(mode == "text")
85 mode = lfs.setmode(f, "text")
86 assert(mode == "binary")
87 f:close()
88end
89
80-- Restore access time to current value 90-- Restore access time to current value
81assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) 91assert (lfs.touch (tmpfile, attrib.access, attrib.modification))
82new_att = assert (lfs.attributes (tmpfile)) 92new_att = assert (lfs.attributes (tmpfile))