diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/test.lua b/tests/test.lua index 133bac2..6eb9f70 100644 --- a/tests/test.lua +++ b/tests/test.lua | |||
| @@ -76,15 +76,13 @@ if (os.execute ("ln -s "..tmpfile.." _a_link_for_test_")) then | |||
| 76 | assert (os.remove"_a_link_for_test_") | 76 | assert (os.remove"_a_link_for_test_") |
| 77 | end | 77 | end |
| 78 | 78 | ||
| 79 | if lfs.setmode then | 79 | -- Checking text/binary modes (only has an effect in Windows) |
| 80 | -- Checking text/binary modes (works only in Windows) | 80 | local f = io.open(tmpfile, "w") |
| 81 | local f = io.open(tmpfile, "w") | 81 | local result, mode = lfs.setmode(f, "binary") |
| 82 | local result, mode = lfs.setmode(f, "binary") | 82 | assert(result) -- on non-Windows platforms, mode is always returned as "binary" |
| 83 | assert((result and mode == "text") or (not result and mode == "setmode not supported on this platform")) | 83 | result, mode = lfs.setmode(f, "text") |
| 84 | result, mode = lfs.setmode(f, "text") | 84 | assert(result and mode == "binary") |
| 85 | assert((result and mode == "binary") or (not result and mode == "setmode not supported on this platform")) | 85 | f:close() |
| 86 | f:close() | ||
| 87 | end | ||
| 88 | 86 | ||
| 89 | -- Restore access time to current value | 87 | -- Restore access time to current value |
| 90 | assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) | 88 | assert (lfs.touch (tmpfile, attrib.access, attrib.modification)) |
