aboutsummaryrefslogtreecommitdiff
path: root/testes/code.lua
diff options
context:
space:
mode:
Diffstat (limited to 'testes/code.lua')
-rw-r--r--testes/code.lua20
1 files changed, 19 insertions, 1 deletions
diff --git a/testes/code.lua b/testes/code.lua
index 9b3f2b68..4d44fa6a 100644
--- a/testes/code.lua
+++ b/testes/code.lua
@@ -339,8 +339,26 @@ check(function (a, b)
339 339
340checkequal( 340checkequal(
341function (a) while a < 10 do a = a + 1 end end, 341function (a) while a < 10 do a = a + 1 end end,
342function (a) while true do if not(a < 10) then break end; a = a + 1; end end 342function (a)
343 ::loop::
344 if not (a < 10) then goto exit end
345 a = a + 1
346 goto loop
347::exit::
348end
343) 349)
344 350
351checkequal(
352function (a) repeat local x = a + 1; a = x until a > 0 end,
353function (a)
354 ::loop:: do
355 local x = a + 1
356 a = x
357 end
358 if not (a > 0) then goto loop end
359end
360)
361
362
345print 'OK' 363print 'OK'
346 364