aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/async
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-11 01:04:06 +0200
committerGitHub <noreply@github.com>2022-04-11 01:04:06 +0200
commit89abfcd2fbd56c3246772726a85ed0e548d77d3b (patch)
tree5a90c3277ee853fe6c1c04be09982b94472f45ab /tests/core/async
parentsumneko_lua: support Linux arm64 (#391) (diff)
downloadmason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.gz
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.bz2
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.lz
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.xz
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.zst
mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.zip
make install context available via coroutine context (#586)
Diffstat (limited to 'tests/core/async')
-rw-r--r--tests/core/async/async_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/async/async_spec.lua b/tests/core/async/async_spec.lua
index 0e881c8b..3eacd145 100644
--- a/tests/core/async/async_spec.lua
+++ b/tests/core/async/async_spec.lua
@@ -120,4 +120,13 @@ describe("async", function()
assert.spy(fn).was_called_with(nil, 2, nil, 4, nil, nil, 7, match.is_function())
end)
)
+
+ it("should not accept yielding non-promise values", function()
+ local err = assert.has_error(function()
+ a.run_blocking(function()
+ coroutine.yield(1)
+ end)
+ end)
+ assert.equals("Expected Promise to have been yielded in async coroutine.", err)
+ end)
end)