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) | |||
734 | assert(a and b == 30) | 734 | assert(a and b == 30) |
735 | 735 | ||
736 | 736 | ||
737 | -- check traceback of suspended (or dead with error) coroutines | 737 | -- check traceback of suspended coroutines |
738 | 738 | ||
739 | function f(i) if i==0 then error(i) else coroutine.yield(); f(i-1) end end | 739 | function f(i) coroutine.yield(i == 0); f(i - 1) end |
740 | 740 | ||
741 | co = coroutine.create(function (x) f(x) end) | 741 | co = coroutine.create(function (x) f(x) end) |
742 | a, b = coroutine.resume(co, 3) | 742 | a, b = coroutine.resume(co, 3) |
743 | t = {"'coroutine.yield'", "'f'", "in function <"} | 743 | t = {"'coroutine.yield'", "'f'", "in function <"} |
744 | while coroutine.status(co) == "suspended" do | 744 | repeat |
745 | checktraceback(co, t) | 745 | checktraceback(co, t) |
746 | a, b = coroutine.resume(co) | 746 | a, b = coroutine.resume(co) |
747 | table.insert(t, 2, "'f'") -- one more recursive call to 'f' | 747 | table.insert(t, 2, "'f'") -- one more recursive call to 'f' |
748 | end | 748 | until b |
749 | t[1] = "'error'" | ||
750 | checktraceback(co, t) | 749 | checktraceback(co, t) |
751 | 750 | ||
752 | 751 | ||