lean2/tests/lua/threads/sleep1.lua
Leonardo de Moura ccb9faf065 refactor(*): error messages
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-13 16:54:21 -08:00

11 lines
191 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))
print(msg:what():find("interrupted"))