aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/loops.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2024-10-19 00:35:11 +0800
committerLi Jin <dragon-fly@qq.com>2024-10-19 00:35:11 +0800
commit1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0 (patch)
tree8bd3fbeb396fd2fce6e5b34c3ee10f4923feca72 /spec/outputs/loops.lua
parent05da3cbfa3689e6c229c41156d0dd08ab554cd77 (diff)
downloadyuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.gz
yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.tar.bz2
yuescript-1334c0ae67fdf4cb1377e0e7a3ef291f5cf694c0.zip
Fixed issue #174.
Diffstat (limited to 'spec/outputs/loops.lua')
-rw-r--r--spec/outputs/loops.lua37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/outputs/loops.lua b/spec/outputs/loops.lua
index 40e27b9..8624d49 100644
--- a/spec/outputs/loops.lua
+++ b/spec/outputs/loops.lua
@@ -333,3 +333,40 @@ do
333 ::_continue_11:: 333 ::_continue_11::
334 end 334 end
335end 335end
336do
337 repeat
338 local byte = stream:read_one()
339 if byte then
340 if byte == 0 then
341 goto _continue_13
342 end
343 print(byte)
344 else
345 break
346 end
347 ::_continue_13::
348 until false
349end
350do
351 local func
352 repeat
353 local success, result = xpcall(func, function(err)
354 return print(err)
355 end, 1, 2, 3)
356 if success then
357 print(result)
358 else
359 break
360 end
361 until false
362end
363do
364 repeat
365 x = func('a', b)
366 if not x then
367 print("false expected")
368 else
369 break
370 end
371 until false
372end