diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2021-08-23 02:37:07 -0700 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2025-05-04 11:22:57 -0400 |
| commit | fc2dee17368d76e7e845872990bb6fdef1c6bf54 (patch) | |
| tree | 6c8862b5b1d17c86bf3bc61065e1c9a8456cb415 /test/functional/lua/api_spec.lua | |
| parent | af4f7f1618ad6e11d616b2c69af8945f46d0e199 (diff) | |
| download | rneovim-fc2dee17368d76e7e845872990bb6fdef1c6bf54.tar.gz rneovim-fc2dee17368d76e7e845872990bb6fdef1c6bf54.tar.bz2 rneovim-fc2dee17368d76e7e845872990bb6fdef1c6bf54.zip | |
feat(messages): cleanup Lua error messages
"Error" in error messages is redundant. Just provide the context, don't
say "Error ...".
Diffstat (limited to 'test/functional/lua/api_spec.lua')
| -rw-r--r-- | test/functional/lua/api_spec.lua | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/functional/lua/api_spec.lua b/test/functional/lua/api_spec.lua index 741ed0cf6e..1712fa2a5d 100644 --- a/test/functional/lua/api_spec.lua +++ b/test/functional/lua/api_spec.lua @@ -303,76 +303,76 @@ describe('luaeval(vim.api.…)', function() it('errors out correctly when working with API', function() -- Conversion errors eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'obj': Cannot convert given Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'obj': Cannot convert given Lua table]], remove_trace(exc_exec([[call luaeval("vim.api.nvim__id({1, foo=42})")]])) ) -- Errors in number of arguments eq( - 'Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Expected 1 argument', + 'Vim(call):E5108: Lua: [string "luaeval()"]:1: Expected 1 argument', remove_trace(exc_exec([[call luaeval("vim.api.nvim__id()")]])) ) eq( - 'Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Expected 1 argument', + 'Vim(call):E5108: Lua: [string "luaeval()"]:1: Expected 1 argument', remove_trace(exc_exec([[call luaeval("vim.api.nvim__id(1, 2)")]])) ) eq( - 'Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Expected 2 arguments', + 'Vim(call):E5108: Lua: [string "luaeval()"]:1: Expected 2 arguments', remove_trace(exc_exec([[call luaeval("vim.api.nvim_set_var(1, 2, 3)")]])) ) -- Error in argument types eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'name': Expected Lua string]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'name': Expected Lua string]], remove_trace(exc_exec([[call luaeval("vim.api.nvim_set_var(1, 2)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'start': Expected Lua number]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'start': Expected Lua number]], remove_trace(exc_exec([[call luaeval("vim.api.nvim_buf_get_lines(0, 'test', 1, false)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'start': Number is not integral]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'start': Number is not integral]], remove_trace(exc_exec([[call luaeval("vim.api.nvim_buf_get_lines(0, 1.5, 1, false)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'window': Expected Lua number]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'window': Expected Lua number]], remove_trace(exc_exec([[call luaeval("vim.api.nvim_win_is_valid(nil)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'flt': Expected Lua number]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'flt': Expected Lua number]], remove_trace(exc_exec([[call luaeval("vim.api.nvim__id_float('test')")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'flt': Expected Float-like Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'flt': Expected Float-like Lua table]], remove_trace( exc_exec([[call luaeval("vim.api.nvim__id_float({[vim.type_idx]=vim.types.dictionary})")]]) ) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'arr': Expected Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'arr': Expected Lua table]], remove_trace(exc_exec([[call luaeval("vim.api.nvim__id_array(1)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'arr': Expected Array-like Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'arr': Expected Array-like Lua table]], remove_trace( exc_exec([[call luaeval("vim.api.nvim__id_array({[vim.type_idx]=vim.types.dictionary})")]]) ) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'dct': Expected Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'dct': Expected Lua table]], remove_trace(exc_exec([[call luaeval("vim.api.nvim__id_dict(1)")]])) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Invalid 'dct': Expected Dict-like Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Invalid 'dct': Expected Dict-like Lua table]], remove_trace( exc_exec([[call luaeval("vim.api.nvim__id_dict({[vim.type_idx]=vim.types.array})")]]) ) ) eq( - [[Vim(call):E5108: Error executing lua [string "luaeval()"]:1: Expected Lua table]], + [[Vim(call):E5108: Lua: [string "luaeval()"]:1: Expected Lua table]], remove_trace(exc_exec([[call luaeval("vim.api.nvim_set_keymap('', '', '', '')")]])) ) |