mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 17:41:48 +00:00
fix(excmd): nlua_call_excmd require() failure is a "lua_error"
Although `nlua_call_excmd` is semantically for implementing Ex-commands, the `require()` should never fail, so that's a "Lua error". But if the call itself fails (the later `semsg` call), that's an "Ex cmd" error.
This commit is contained in:
@@ -8,7 +8,20 @@ local fn = n.fn
|
||||
local pcall_err = t.pcall_err
|
||||
local assert_alive = n.assert_alive
|
||||
|
||||
describe('Ex cmds', function()
|
||||
describe('nlua_call_excmd excmds', function()
|
||||
-- Exercise nlua_call_excmd by testing commands implemented with it (:log, :lsp).
|
||||
|
||||
before_each(function()
|
||||
clear()
|
||||
end)
|
||||
|
||||
it('error propagation, formatting', function()
|
||||
t.eq('Vim(lsp):E5800: Invalid :lsp subcommand: bogus', pcall_err(command, 'lsp bogus'))
|
||||
t.matches('Vim%(log%):E5200: No such log.*', pcall_err(command, 'log bogus'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('excmds', function()
|
||||
before_each(function()
|
||||
clear()
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user