diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2015-08-23 00:38:38 +0200 |
|---|---|---|
| committer | Philipp Janda <siffiejoe@gmx.net> | 2015-08-23 00:38:38 +0200 |
| commit | 65658e90ffcf6a84f13ec7c781c228e4e36f1799 (patch) | |
| tree | 738db259b0d31c7be91e2cf61523b2d32b800999 /tests/test.lua | |
| parent | 6190ad90c7960579ec31ffcd79e9e59cf2d48c05 (diff) | |
| download | lua-compat-5.3-65658e90ffcf6a84f13ec7c781c228e4e36f1799.tar.gz lua-compat-5.3-65658e90ffcf6a84f13ec7c781c228e4e36f1799.tar.bz2 lua-compat-5.3-65658e90ffcf6a84f13ec7c781c228e4e36f1799.zip | |
Make '*' optional for io.read() and io.lines().
Diffstat (limited to 'tests/test.lua')
| -rwxr-xr-x | tests/test.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test.lua b/tests/test.lua index 7e9d57f..c634ebe 100755 --- a/tests/test.lua +++ b/tests/test.lua | |||
| @@ -540,6 +540,18 @@ end | |||
| 540 | ___'' | 540 | ___'' |
| 541 | do | 541 | do |
| 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") | ||
| 544 | print(io.read("*n", "*number", "*l", "*a")) | ||
| 545 | io.input("data.txt") | ||
| 546 | print(io.read("n", "number", "l", "a")) | ||
| 547 | io.input(io.stdin) | ||
| 548 | os.remove("data.txt") | ||
| 549 | end | ||
| 550 | |||
| 551 | |||
| 552 | ___'' | ||
| 553 | do | ||
| 554 | writefile("data.txt", "123 18.8 hello world\ni'm here\n") | ||
| 543 | for a,b in io.lines("test.lua", 2, "*l") do | 555 | for a,b in io.lines("test.lua", 2, "*l") do |
| 544 | print("io.lines()", a, b) | 556 | print("io.lines()", a, b) |
| 545 | break | 557 | break |
| @@ -548,7 +560,7 @@ do | |||
| 548 | print("io.lines()", l) | 560 | print("io.lines()", l) |
| 549 | break | 561 | break |
| 550 | end | 562 | end |
| 551 | for n1,n2,rest in io.lines("data.txt", "*n", "*n", "*a") do | 563 | for n1,n2,rest in io.lines("data.txt", "*n", "n", "*a") do |
| 552 | print("io.lines()", n1, n2, rest) | 564 | print("io.lines()", n1, n2, rest) |
| 553 | end | 565 | end |
| 554 | for l in io.lines("data.txt") do | 566 | for l in io.lines("data.txt") do |
