From cdff82828c31d14b805213c68b8040ff2958d291 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 22 Mar 2018 11:56:03 +0000 Subject: util.async: tests: ensure async.once() propagates errors --- spec/util_async_spec.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') 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); -- cgit v1.2.3