diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/test.lua | 14 |
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 @@ ___'' | |||
| 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") | 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") |
| 549 | end | 557 | end |
| 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() |
