diff options
Diffstat (limited to '')
-rw-r--r-- | testes/files.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/testes/files.lua b/testes/files.lua index 53edf314..7146ac7c 100644 --- a/testes/files.lua +++ b/testes/files.lua | |||
@@ -1,6 +1,8 @@ | |||
1 | -- $Id: testes/files.lua $ | 1 | -- $Id: testes/files.lua $ |
2 | -- See Copyright Notice in file lua.h | 2 | -- See Copyright Notice in file lua.h |
3 | 3 | ||
4 | global <const> * | ||
5 | |||
4 | local debug = require "debug" | 6 | local debug = require "debug" |
5 | 7 | ||
6 | local maxint = math.maxinteger | 8 | local maxint = math.maxinteger |
@@ -478,7 +480,7 @@ do print("testing flush") | |||
478 | end | 480 | end |
479 | 481 | ||
480 | 482 | ||
481 | -- test for multipe arguments in 'lines' | 483 | -- test for multiple arguments in 'lines' |
482 | io.output(file); io.write"0123456789\n":close() | 484 | io.output(file); io.write"0123456789\n":close() |
483 | for a,b in io.lines(file, 1, 1) do | 485 | for a,b in io.lines(file, 1, 1) do |
484 | if a == "\n" then assert(not b) | 486 | if a == "\n" then assert(not b) |
@@ -713,7 +715,7 @@ do | |||
713 | end | 715 | end |
714 | 716 | ||
715 | 717 | ||
716 | if T and T.nonblock then | 718 | if T and T.nonblock and not _port then |
717 | print("testing failed write") | 719 | print("testing failed write") |
718 | 720 | ||
719 | -- unable to write anything to /dev/full | 721 | -- unable to write anything to /dev/full |
@@ -838,13 +840,13 @@ assert(os.date("!\0\0") == "\0\0") | |||
838 | local x = string.rep("a", 10000) | 840 | local x = string.rep("a", 10000) |
839 | assert(os.date(x) == x) | 841 | assert(os.date(x) == x) |
840 | local t = os.time() | 842 | local t = os.time() |
841 | D = os.date("*t", t) | 843 | global D = os.date("*t", t) |
842 | assert(os.date(string.rep("%d", 1000), t) == | 844 | assert(os.date(string.rep("%d", 1000), t) == |
843 | string.rep(os.date("%d", t), 1000)) | 845 | string.rep(os.date("%d", t), 1000)) |
844 | assert(os.date(string.rep("%", 200)) == string.rep("%", 100)) | 846 | assert(os.date(string.rep("%", 200)) == string.rep("%", 100)) |
845 | 847 | ||
846 | local function checkDateTable (t) | 848 | local function checkDateTable (t) |
847 | _G.D = os.date("*t", t) | 849 | D = os.date("*t", t) |
848 | assert(os.time(D) == t) | 850 | assert(os.time(D) == t) |
849 | load(os.date([[assert(D.year==%Y and D.month==%m and D.day==%d and | 851 | load(os.date([[assert(D.year==%Y and D.month==%m and D.day==%d and |
850 | D.hour==%H and D.min==%M and D.sec==%S and | 852 | D.hour==%H and D.min==%M and D.sec==%S and |