# HG changeset patch # User Matthew Wild # Date 1521719763 0 # Node ID 2f133b6e8740fab9f4f73cb94de38b2d4b3b643f # Parent 9246f64d6f1e6da8463175e03215e7dd9a27b07f util.async: tests: ensure async.once() propagates errors diff -r 9246f64d6f1e -r 2f133b6e8740 spec/util_async_spec.lua --- 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);