aboutsummaryrefslogtreecommitdiff
path: root/testes/nextvar.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-13 11:43:10 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-13 11:43:10 -0300
commit3b9dd52be02fd43c598f4adb6fa7844e6a573923 (patch)
tree8f858942f5db0e3d9d7cad503b59ee1541a60aa6 /testes/nextvar.lua
parent7dc6aae29057c9dc4588f780c7abd72a62ff4c8e (diff)
downloadlua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.gz
lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.tar.bz2
lua-3b9dd52be02fd43c598f4adb6fa7844e6a573923.zip
Collective declaration for globals ('global *')
Diffstat (limited to 'testes/nextvar.lua')
-rw-r--r--testes/nextvar.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/testes/nextvar.lua b/testes/nextvar.lua
index 679cb1e4..e5a97178 100644
--- a/testes/nextvar.lua
+++ b/testes/nextvar.lua
@@ -1,6 +1,8 @@
1-- $Id: testes/nextvar.lua $ 1-- $Id: testes/nextvar.lua $
2-- See Copyright Notice in file lua.h 2-- See Copyright Notice in file lua.h
3 3
4global * <const>
5
4print('testing tables, next, and for') 6print('testing tables, next, and for')
5 7
6local function checkerror (msg, f, ...) 8local function checkerror (msg, f, ...)
@@ -345,9 +347,6 @@ end
345 347
346local nofind = {} 348local nofind = {}
347 349
348a,b,c = 1,2,3
349a,b,c = nil
350
351 350
352-- next uses always the same iteration function 351-- next uses always the same iteration function
353assert(next{} == next{}) 352assert(next{} == next{})
@@ -396,7 +395,7 @@ for i=0,10000 do
396 end 395 end
397end 396end
398 397
399n = {n=0} 398local n = {n=0}
400for i,v in pairs(a) do 399for i,v in pairs(a) do
401 n.n = n.n+1 400 n.n = n.n+1
402 assert(i and v and a[i] == v) 401 assert(i and v and a[i] == v)