diff options
Diffstat (limited to 'unit_tests/scripts/coro/basics.lua')
| -rw-r--r-- | unit_tests/scripts/coro/basics.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/unit_tests/scripts/coro/basics.lua b/unit_tests/scripts/coro/basics.lua index cd2f410..c0b7a36 100644 --- a/unit_tests/scripts/coro/basics.lua +++ b/unit_tests/scripts/coro/basics.lua | |||
| @@ -85,7 +85,8 @@ if true then | |||
| 85 | assert(h3:resume(1) == nil) | 85 | assert(h3:resume(1) == nil) |
| 86 | 86 | ||
| 87 | -- similarly, we can get them with join() | 87 | -- similarly, we can get them with join() |
| 88 | assert(h3:join() == "world" and h3.status == "suspended") | 88 | local r3, ret3 = h3:join() |
| 89 | assert(r3 == true and ret3 == "world" and h3.status == "suspended") | ||
| 89 | -- since we consumed the returned values, they should not be here when we resume | 90 | -- since we consumed the returned values, they should not be here when we resume |
| 90 | assert(h3:resume(2) == nil) | 91 | assert(h3:resume(2) == nil) |
| 91 | 92 | ||
| @@ -93,5 +94,6 @@ if true then | |||
| 93 | assert(h3:resume(3) == "!") | 94 | assert(h3:resume(3) == "!") |
| 94 | 95 | ||
| 95 | -- the final return value of the lane body remains to be read | 96 | -- the final return value of the lane body remains to be read |
| 96 | assert(h3:join() == "done!" and h3.status == "done") | 97 | local r3, ret3 = h3:join() |
| 98 | assert(r3 == true and ret3 == "done!" and h3.status == "done") | ||
| 97 | end | 99 | end |
