From 65658e90ffcf6a84f13ec7c781c228e4e36f1799 Mon Sep 17 00:00:00 2001 From: Philipp Janda Date: Sun, 23 Aug 2015 00:38:38 +0200 Subject: Make '*' optional for io.read() and io.lines(). --- tests/test.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test.lua b/tests/test.lua index 7e9d57f..c634ebe 100755 --- a/tests/test.lua +++ b/tests/test.lua @@ -537,6 +537,18 @@ do end +___'' +do + writefile("data.txt", "123 18.8 hello world\ni'm here\n") + io.input("data.txt") + print(io.read("*n", "*number", "*l", "*a")) + io.input("data.txt") + print(io.read("n", "number", "l", "a")) + io.input(io.stdin) + os.remove("data.txt") +end + + ___'' do writefile("data.txt", "123 18.8 hello world\ni'm here\n") @@ -548,7 +560,7 @@ do print("io.lines()", l) break end - for n1,n2,rest in io.lines("data.txt", "*n", "*n", "*a") do + for n1,n2,rest in io.lines("data.txt", "*n", "n", "*a") do print("io.lines()", n1, n2, rest) end for l in io.lines("data.txt") do -- cgit v1.2.3-55-g6feb