test(lua): add Lua 'yield' test

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-26 04:39:53 -07:00
parent 38a826013c
commit 701b60d2d9

11
tests/lua/yield.lua Normal file
View 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()