lean2/tests/lua/yield.lua
Leonardo de Moura 701b60d2d9 test(lua): add Lua 'yield' test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-26 04:39:53 -07:00

11 lines
178 B
Lua

function foo()
print("foo", 1)
yield()
print("foo", 2)
end
co = coroutine.create(foo)
print(coroutine.resume(co))
print("--------")
print(coroutine.resume(co))
yield()