summaryrefslogtreecommitdiff
path: root/testes/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/files.lua')
-rw-r--r--testes/files.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/testes/files.lua b/testes/files.lua
index 54931c14..c8f23d18 100644
--- a/testes/files.lua
+++ b/testes/files.lua
@@ -427,10 +427,12 @@ do -- testing closing file in line iteration
-- get the to-be-closed variable from a loop
local function gettoclose (lv)
lv = lv + 1
- for i = 1, math.maxinteger do
+ local stvar = 0 -- to-be-closed is 4th state variable in the loop
+ for i = 1, 1000 do
local n, v = debug.getlocal(lv, i)
- if n == "(for toclose)" then
- return v
+ if n == "(for state)" then
+ stvar = stvar + 1
+ if stvar == 4 then return v end
end
end
end