Skip to content

Commit

Permalink
test: assert coroutine.resume() result
Browse files Browse the repository at this point in the history
`coroutine.resume()` works similarly to `pcall()` and catches any
errors. Ensure errors thrown in coroutine are propagated by asserting
on the values returned by `coroutine.resume()`.
  • Loading branch information
tmillr committed Jul 11, 2024
1 parent 13f67fc commit 7205574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/github-theme/_test/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function M.await_VimEnter()
once = true,
nested = true,
callback = vim.schedule_wrap(function()
coroutine.resume(co)
assert(coroutine.resume(co))
end),
})

Expand Down

0 comments on commit 7205574

Please sign in to comment.