diff options
Diffstat (limited to 'testes/code.lua')
| -rw-r--r-- | testes/code.lua | 20 |
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 | ||
| 340 | checkequal( | 340 | checkequal( |
| 341 | function (a) while a < 10 do a = a + 1 end end, | 341 | function (a) while a < 10 do a = a + 1 end end, |
| 342 | function (a) while true do if not(a < 10) then break end; a = a + 1; end end | 342 | function (a) |
| 343 | ::loop:: | ||
| 344 | if not (a < 10) then goto exit end | ||
| 345 | a = a + 1 | ||
| 346 | goto loop | ||
| 347 | ::exit:: | ||
| 348 | end | ||
| 343 | ) | 349 | ) |
| 344 | 350 | ||
| 351 | checkequal( | ||
| 352 | function (a) repeat local x = a + 1; a = x until a > 0 end, | ||
| 353 | function (a) | ||
| 354 | ::loop:: do | ||
| 355 | local x = a + 1 | ||
| 356 | a = x | ||
| 357 | end | ||
| 358 | if not (a > 0) then goto loop end | ||
| 359 | end | ||
| 360 | ) | ||
| 361 | |||
| 362 | |||
| 345 | print 'OK' | 363 | print 'OK' |
| 346 | 364 | ||
