aboutsummaryrefslogtreecommitdiff
path: root/testes/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/files.lua')
-rw-r--r--testes/files.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/testes/files.lua b/testes/files.lua
index be00bf3f..1476006e 100644
--- a/testes/files.lua
+++ b/testes/files.lua
@@ -92,8 +92,8 @@ assert(io.output():seek("end") == string.len("alo joao"))
92 92
93assert(io.output():seek("set") == 0) 93assert(io.output():seek("set") == 0)
94 94
95assert(io.write('"lo"', "{a}\n", "second line\n", "third line \n")) 95assert(io.write('"alo"', "{a}\n", "second line\n", "third line \n"))
96assert(io.write('fourth_line')) 96assert(io.write('Xfourth_line'))
97io.output(io.stdout) 97io.output(io.stdout)
98collectgarbage() -- file should be closed by GC 98collectgarbage() -- file should be closed by GC
99assert(io.input() == io.stdin and rawequal(io.output(), io.stdout)) 99assert(io.input() == io.stdin and rawequal(io.output(), io.stdout))
@@ -300,14 +300,14 @@ do -- test error returns
300end 300end
301checkerr("invalid format", io.read, "x") 301checkerr("invalid format", io.read, "x")
302assert(io.read(0) == "") -- not eof 302assert(io.read(0) == "") -- not eof
303assert(io.read(5, 'l') == '"lo"') 303assert(io.read(5, 'l') == '"alo"')
304assert(io.read(0) == "") 304assert(io.read(0) == "")
305assert(io.read() == "second line") 305assert(io.read() == "second line")
306local x = io.input():seek() 306local x = io.input():seek()
307assert(io.read() == "third line ") 307assert(io.read() == "third line ")
308assert(io.input():seek("set", x)) 308assert(io.input():seek("set", x))
309assert(io.read('L') == "third line \n") 309assert(io.read('L') == "third line \n")
310assert(io.read(1) == "") 310assert(io.read(1) == "X")
311assert(io.read(string.len"fourth_line") == "fourth_line") 311assert(io.read(string.len"fourth_line") == "fourth_line")
312assert(io.input():seek("cur", -string.len"fourth_line")) 312assert(io.input():seek("cur", -string.len"fourth_line"))
313assert(io.read() == "fourth_line") 313assert(io.read() == "fourth_line")