fix(api): use standard error messages

This commit is contained in:
Justin M. Keyes
2026-03-14 17:56:19 +01:00
parent ca67ba3b66
commit 680d25e5b3
23 changed files with 401 additions and 312 deletions

View File

@@ -44,7 +44,7 @@ describe('luaeval(vim.api.…)', function()
it('transforms API error from nvim_win_set_cursor into lua error', function()
eq(
{ false, 'Argument "pos" must be a [row, col] array' },
{ false, "Invalid 'pos': expected [row, col] array" },
fn.luaeval('{pcall(vim.api.nvim_win_set_cursor, 0, {1, 2, 3})}')
)
-- Used to produce a memory leak due to a bug in nvim_win_set_cursor
@@ -58,7 +58,7 @@ describe('luaeval(vim.api.…)', function()
'transforms API error from nvim_win_set_cursor + same array as in first test into lua error',
function()
eq(
{ false, 'Argument "pos" must be a [row, col] array' },
{ false, "Invalid 'pos': expected [row, col] array" },
fn.luaeval('{pcall(vim.api.nvim_win_set_cursor, 0, {"b\\na"})}')
)
end