lean2/tests/lua/threads/sleep1.lua
Leonardo de Moura 0934d7b2f4 fix(frontends/lua): make sure Lua 'sleep' function support interruption
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 13:25:06 -08:00

11 lines
189 B
Lua

S = State()
T = thread(S, [[
sleep(10000)
]])
T:interrupt()
local ok, msg = pcall(function() T:wait() end)
assert(not ok)
assert(is_exception(msg))
assert(msg:what() == "interrupted")