aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2015-08-24 01:39:46 +0200
committerPhilipp Janda <siffiejoe@gmx.net>2015-08-24 01:39:46 +0200
commit7baf0a38ca7ed07784ad3e08e8e85b66de05eae6 (patch)
treebe07927fe6b2c515b9ce94cf972828c83fa1794f /tests
parent65658e90ffcf6a84f13ec7c781c228e4e36f1799 (diff)
downloadlua-compat-5.3-7baf0a38ca7ed07784ad3e08e8e85b66de05eae6.tar.gz
lua-compat-5.3-7baf0a38ca7ed07784ad3e08e8e85b66de05eae6.tar.bz2
lua-compat-5.3-7baf0a38ca7ed07784ad3e08e8e85b66de05eae6.zip
Make '*' optional for file:lines() and file:read().
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/test.lua b/tests/test.lua
index c634ebe..0c77240 100755
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -541,10 +541,18 @@ ___''
541do 541do
542 writefile("data.txt", "123 18.8 hello world\ni'm here\n") 542 writefile("data.txt", "123 18.8 hello world\ni'm here\n")
543 io.input("data.txt") 543 io.input("data.txt")
544 print(io.read("*n", "*number", "*l", "*a")) 544 print("io.read()", io.read("*n", "*number", "*l", "*a"))
545 io.input("data.txt") 545 io.input("data.txt")
546 print(io.read("n", "number", "l", "a")) 546 print("io.read()", io.read("n", "number", "l", "a"))
547 io.input(io.stdin) 547 io.input(io.stdin)
548 if mode ~= "module" then
549 local f = assert(io.open("data.txt", "r"))
550 print("file:read()", f:read("*n", "*number", "*l", "*a"))
551 f:close()
552 f = assert(io.open("data.txt", "r"))
553 print("file:read()", f:read("n", "number", "l", "a"))
554 f:close()
555 end
548 os.remove("data.txt") 556 os.remove("data.txt")
549end 557end
550 558
@@ -580,7 +588,7 @@ do
580 end 588 end
581 f:close() 589 f:close()
582 f = assert(io.open("data.txt", "r")) 590 f = assert(io.open("data.txt", "r"))
583 for n1,n2,rest in f:lines("*n", "*n", "*a") do 591 for n1,n2,rest in f:lines("*n", "n", "*a") do
584 print("file:lines()", n1, n2, rest) 592 print("file:lines()", n1, n2, rest)
585 end 593 end
586 f:close() 594 f:close()