diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-22 11:56:03 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-22 11:56:03 +0000 |
commit | caab5a40c2db93af5d2edfdf426c918c26694886 (patch) | |
tree | 6347351b2b665b486d94dac84c6daa2b434ef0cf /spec/util_async_spec.lua | |
parent | c600e0f6f60245d4c5ed9287fb5f2ccbdf06d8f1 (diff) | |
download | prosody-caab5a40c2db93af5d2edfdf426c918c26694886.tar.gz prosody-caab5a40c2db93af5d2edfdf426c918c26694886.zip |
util.async: tests: ensure async.once() propagates errors
Diffstat (limited to 'spec/util_async_spec.lua')
-rw-r--r-- | spec/util_async_spec.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/util_async_spec.lua b/spec/util_async_spec.lua index f7e469c9..7c1696b5 100644 --- a/spec/util_async_spec.lua +++ b/spec/util_async_spec.lua @@ -602,5 +602,13 @@ describe("util.async", function() async.once(f); assert.spy(f).was.called(); end); + it("should propagate errors", function () + local function should_error() + async.once(function () + error("hello world"); + end); + end; + assert.error_matches(should_error, "hello world"); + end); end); end); |