From db7e8b913315e269afde7bd20b54cbc9514a5f9d Mon Sep 17 00:00:00 2001 From: carregal Date: Wed, 13 Feb 2008 20:59:51 +0000 Subject: Adding tests for lfs.setmode --- tests/test.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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)) -- cgit v1.2.3-55-g6feb