diff options
author | carregal <carregal> | 2008-02-13 20:59:51 +0000 |
---|---|---|
committer | carregal <carregal> | 2008-02-13 20:59:51 +0000 |
commit | db7e8b913315e269afde7bd20b54cbc9514a5f9d (patch) | |
tree | a98e1ce03bc5fa7ff7cf86bc6282121dbb0e37a5 /tests | |
parent | d931b9b2bb50bd8316393a6dbdf7b845a2b5e1ef (diff) | |
download | luafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.tar.gz luafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.tar.bz2 luafilesystem-db7e8b913315e269afde7bd20b54cbc9514a5f9d.zip |
Adding tests for lfs.setmode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test.lua | 10 |
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_") |
78 | end | 78 | end |
79 | 79 | ||
80 | if 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() | ||
88 | end | ||
89 | |||
80 | -- Restore access time to current value | 90 | -- Restore access time to current value |
81 | assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) | 91 | assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) |
82 | new_att = assert (lfs.attributes (tmpfile)) | 92 | new_att = assert (lfs.attributes (tmpfile)) |