Skip to content

Commit

Permalink
add error testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Jul 31, 2024
1 parent 8c4d8d7 commit 2b27e8e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions async.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,16 @@ mtt.register("Promise.async rejected", function(callback)
assert(type(e) == "string")
callback()
end)
end)

mtt.register("Promise.async error", function(callback)
local p = Promise.async(function()
error("stuff")
end)

p:catch(function(e)
-- "/home/user/.minetest/mods/promise/async.spec.lua:55: stuff"
assert(type(e) == "string")
callback()
end)
end)

0 comments on commit 2b27e8e

Please sign in to comment.