diff options
Diffstat (limited to 'testes/db.lua')
-rw-r--r-- | testes/db.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/testes/db.lua b/testes/db.lua index 2feaaef1..9da68210 100644 --- a/testes/db.lua +++ b/testes/db.lua @@ -734,19 +734,18 @@ a, b = coroutine.resume(co, 100) assert(a and b == 30) --- check traceback of suspended (or dead with error) coroutines +-- check traceback of suspended coroutines -function f(i) if i==0 then error(i) else coroutine.yield(); f(i-1) end end +function f(i) coroutine.yield(i == 0); f(i - 1) end co = coroutine.create(function (x) f(x) end) a, b = coroutine.resume(co, 3) t = {"'coroutine.yield'", "'f'", "in function <"} -while coroutine.status(co) == "suspended" do +repeat checktraceback(co, t) a, b = coroutine.resume(co) table.insert(t, 2, "'f'") -- one more recursive call to 'f' -end -t[1] = "'error'" +until b checktraceback(co, t) |