aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-06-16 15:50:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-06-16 15:50:12 -0300
commit8cd7ae7da06f54b97f95d6994d6bf47086e4e7eb (patch)
treecb274fe70f332e3151abea0c58fde17c9c127e57 /testes
parent0cecf1ab6d76e6a7d200fb01bdd999b61835fe21 (diff)
downloadlua-8cd7ae7da06f54b97f95d6994d6bf47086e4e7eb.tar.gz
lua-8cd7ae7da06f54b97f95d6994d6bf47086e4e7eb.tar.bz2
lua-8cd7ae7da06f54b97f95d6994d6bf47086e4e7eb.zip
Simpler code for 'traversetable'
Check the mode in a separate function (getmode), instead of using comma expressions inside the 'if' condition.
Diffstat (limited to 'testes')
-rw-r--r--testes/gc.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/testes/gc.lua b/testes/gc.lua
index ca8aa1bc..5d2b3085 100644
--- a/testes/gc.lua
+++ b/testes/gc.lua
@@ -288,6 +288,11 @@ x,y,z=nil
288collectgarbage() 288collectgarbage()
289assert(next(a) == string.rep('$', 11)) 289assert(next(a) == string.rep('$', 11))
290 290
291do -- invalid mode
292 local a = setmetatable({}, {__mode = 34})
293 collectgarbage()
294end
295
291 296
292-- 'bug' in 5.1 297-- 'bug' in 5.1
293a = {} 298a = {}