Mercurial > prosody-hg
diff spec/util_async_spec.lua @ 8608:a2e6caf5848d
util.async: Add test to ensure waiters throw an error outside async contexts
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 16 Mar 2018 22:19:33 +0000 |
| parents | 62bb06cf8a43 |
| children | 9f6ab206d741 |
line wrap: on
line diff
--- a/spec/util_async_spec.lua Fri Mar 16 17:50:16 2018 +0000 +++ b/spec/util_async_spec.lua Fri Mar 16 22:19:33 2018 +0000 @@ -84,6 +84,11 @@ end); end); describe("#waiter", function() + it("should error outside of async context", function () + assert.has_error(function () + async.waiter(); + end); + end); it("should work", function () local wait, done;
