test(lua): add Lua 'yield' test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
38a826013c
commit
701b60d2d9
1 changed files with 11 additions and 0 deletions
11
tests/lua/yield.lua
Normal file
11
tests/lua/yield.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
function foo()
|
||||
print("foo", 1)
|
||||
yield()
|
||||
print("foo", 2)
|
||||
end
|
||||
|
||||
co = coroutine.create(foo)
|
||||
print(coroutine.resume(co))
|
||||
print("--------")
|
||||
print(coroutine.resume(co))
|
||||
yield()
|
Loading…
Reference in a new issue