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

@@ -729,7 +729,7 @@ describe('API', function()
pcall_err(request, 'nvim_call_dict_function', "{ 'f': '' }", 'f', { 1, 2 })
)
eq(
'dict argument type must be String or Dict',
'Invalid dict argument: expected String or Dict',
pcall_err(request, 'nvim_call_dict_function', 42, 'f', { 1, 2 })
)
eq(
@@ -738,7 +738,7 @@ describe('API', function()
)
eq('dict not found', pcall_err(request, 'nvim_call_dict_function', '42', 'f', { 1, 2 }))
eq(
'Invalid (empty) function name',
'Invalid function name: (empty)',
pcall_err(request, 'nvim_call_dict_function', "{ 'f': '' }", '', { 1, 2 })
)
end)
@@ -3791,7 +3791,7 @@ describe('API', function()
'Invalid chunk: expected Array with 1 or 2 Strings',
pcall_err(api.nvim_echo, { { '', '', '' } }, 1, {})
)
eq('Invalid hl_group: text highlight', pcall_err(api.nvim_echo, { { '', false } }, 1, {}))
eq("Invalid 'hl_group': 'text highlight'", pcall_err(api.nvim_echo, { { '', false } }, 1, {}))
end)
it('should clear cmdline message before echo', function()