Software /
code /
prosody
Changeset
8650:2f133b6e8740
util.async: tests: ensure async.once() propagates errors
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 22 Mar 2018 11:56:03 +0000 |
parents | 8649:9246f64d6f1e |
children | 8651:1b7c5933b215 |
files | spec/util_async_spec.lua |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_async_spec.lua Thu Mar 22 07:56:01 2018 +0000 +++ b/spec/util_async_spec.lua Thu Mar 22 11:56:03 2018 +0000 @@ -602,5 +602,13 @@ 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);