diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-08-23 15:14:03 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-08-23 15:14:03 -0300 |
commit | c815c2f0eb7a4ac01d4f664f3db44c199ee4e211 (patch) | |
tree | 63cdeea69af0df9ff82303d05c517068eb54e56e /testes/files.lua | |
parent | ab6a94952215b1f66436d8eeebded1dad9fa5409 (diff) | |
parent | 9363a8b9901a5643c9da061ea8dda8a86cdc7ef1 (diff) | |
download | lua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.tar.gz lua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.tar.bz2 lua-c815c2f0eb7a4ac01d4f664f3db44c199ee4e211.zip |
Merge branch 'master' into nextversion
Diffstat (limited to 'testes/files.lua')
-rw-r--r-- | testes/files.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/testes/files.lua b/testes/files.lua index 149e9c76..2582406f 100644 --- a/testes/files.lua +++ b/testes/files.lua | |||
@@ -92,8 +92,8 @@ assert(io.output():seek("end") == string.len("alo joao")) | |||
92 | 92 | ||
93 | assert(io.output():seek("set") == 0) | 93 | assert(io.output():seek("set") == 0) |
94 | 94 | ||
95 | assert(io.write('"álo"', "{a}\n", "second line\n", "third line \n")) | 95 | assert(io.write('"alo"', "{a}\n", "second line\n", "third line \n")) |
96 | assert(io.write('çfourth_line')) | 96 | assert(io.write('Xfourth_line')) |
97 | io.output(io.stdout) | 97 | io.output(io.stdout) |
98 | collectgarbage() -- file should be closed by GC | 98 | collectgarbage() -- file should be closed by GC |
99 | assert(io.input() == io.stdin and rawequal(io.output(), io.stdout)) | 99 | assert(io.input() == io.stdin and rawequal(io.output(), io.stdout)) |
@@ -300,14 +300,14 @@ do -- test error returns | |||
300 | end | 300 | end |
301 | checkerr("invalid format", io.read, "x") | 301 | checkerr("invalid format", io.read, "x") |
302 | assert(io.read(0) == "") -- not eof | 302 | assert(io.read(0) == "") -- not eof |
303 | assert(io.read(5, 'l') == '"álo"') | 303 | assert(io.read(5, 'l') == '"alo"') |
304 | assert(io.read(0) == "") | 304 | assert(io.read(0) == "") |
305 | assert(io.read() == "second line") | 305 | assert(io.read() == "second line") |
306 | local x = io.input():seek() | 306 | local x = io.input():seek() |
307 | assert(io.read() == "third line ") | 307 | assert(io.read() == "third line ") |
308 | assert(io.input():seek("set", x)) | 308 | assert(io.input():seek("set", x)) |
309 | assert(io.read('L') == "third line \n") | 309 | assert(io.read('L') == "third line \n") |
310 | assert(io.read(1) == "ç") | 310 | assert(io.read(1) == "X") |
311 | assert(io.read(string.len"fourth_line") == "fourth_line") | 311 | assert(io.read(string.len"fourth_line") == "fourth_line") |
312 | assert(io.input():seek("cur", -string.len"fourth_line")) | 312 | assert(io.input():seek("cur", -string.len"fourth_line")) |
313 | assert(io.read() == "fourth_line") | 313 | assert(io.read() == "fourth_line") |