diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-13 11:43:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-05-13 11:43:10 -0300 |
commit | 3b9dd52be02fd43c598f4adb6fa7844e6a573923 (patch) | |
tree | 8f858942f5db0e3d9d7cad503b59ee1541a60aa6 /testes/files.lua | |
parent | 7dc6aae29057c9dc4588f780c7abd72a62ff4c8e (diff) | |
download | lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.gz lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.bz2 lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.zip |
Collective declaration for globals ('global *')
Diffstat (limited to 'testes/files.lua')
-rw-r--r-- | testes/files.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testes/files.lua b/testes/files.lua index a0ae661c..c2b355fb 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 |
@@ -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; 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 |