test(git/object): cover URI parsing, M.open, and open_under_cursor
This commit is contained in:
@@ -161,4 +161,17 @@ function M.wait_for(cond, msg, timeout)
|
||||
M.truthy(vim.wait(timeout or 1000, cond), "timed out waiting for: " .. msg)
|
||||
end
|
||||
|
||||
---Run `fn` with `vim.notify` stubbed to a no-op so error/warning paths
|
||||
---don't bleed onto the test runner's stdout.
|
||||
---@param fn fun()
|
||||
function M.quietly(fn)
|
||||
local orig = vim.notify
|
||||
vim.notify = function() end
|
||||
local ok, err = pcall(fn)
|
||||
vim.notify = orig
|
||||
if not ok then
|
||||
error(err, 0)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user