mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
messages: use proper multiline error message for rpcrequest and API wrappers
This commit is contained in:
@@ -10,7 +10,7 @@ local ok = helpers.ok
|
||||
local meths = helpers.meths
|
||||
local spawn, merge_args = helpers.spawn, helpers.merge_args
|
||||
local set_session = helpers.set_session
|
||||
local expect_err = helpers.expect_err
|
||||
local meth_pcall = helpers.meth_pcall
|
||||
|
||||
describe('server -> client', function()
|
||||
local cid
|
||||
@@ -221,8 +221,8 @@ describe('server -> client', function()
|
||||
end)
|
||||
|
||||
it('returns an error if the request failed', function()
|
||||
expect_err('Vim:Invalid method: does%-not%-exist',
|
||||
eval, "rpcrequest(vim, 'does-not-exist')")
|
||||
eq({false, "Vim:Error invoking 'does-not-exist' on channel 3:\nInvalid method: does-not-exist" },
|
||||
meth_pcall(eval, "rpcrequest(vim, 'does-not-exist')"))
|
||||
end)
|
||||
end)
|
||||
|
||||
|
||||
@@ -892,7 +892,7 @@ describe('API', function()
|
||||
eq({info=info}, meths.get_var("opened_event"))
|
||||
eq({[1]=testinfo,[2]=stderr,[3]=info}, meths.list_chans())
|
||||
eq(info, meths.get_chan_info(3))
|
||||
eval('rpcrequest(3, "nvim_set_client_info", "cat", {}, "remote",'..
|
||||
eval('rpcrequest(3, "nvim_set_client_info", "amazing-cat", {}, "remote",'..
|
||||
'{"nvim_command":{"n_args":1}},'.. -- and so on
|
||||
'{"description":"The Amazing Cat"})')
|
||||
info = {
|
||||
@@ -900,7 +900,7 @@ describe('API', function()
|
||||
id=3,
|
||||
mode='rpc',
|
||||
client = {
|
||||
name='cat',
|
||||
name='amazing-cat',
|
||||
version={major=0},
|
||||
type='remote',
|
||||
methods={nvim_command={n_args=1}},
|
||||
@@ -909,6 +909,9 @@ describe('API', function()
|
||||
}
|
||||
eq({info=info}, meths.get_var("info_event"))
|
||||
eq({[1]=testinfo,[2]=stderr,[3]=info}, meths.list_chans())
|
||||
|
||||
eq({false, "Vim:Error invoking 'nvim_set_current_buf' on channel 3 (amazing-cat):\nWrong type for argument 1, expecting Buffer"},
|
||||
meth_pcall(eval, 'rpcrequest(3, "nvim_set_current_buf", -1)'))
|
||||
end)
|
||||
|
||||
it('works for :terminal channel', function()
|
||||
|
||||
Reference in New Issue
Block a user