mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
functests: Add another check for the similar transformation
Reasoning is majorly the same: check whether lua has bug or API function has bug, but on the other side: previous commit is checking whether similar bug when using API via msgpack RPC, this commit is checking whether another API function used via lua bindings triggers the same bug. Should additionally give a hint about which lua code contains a bug.
This commit is contained in:
@@ -29,11 +29,17 @@ describe('luaeval(vim.api.…)', function()
|
||||
end)
|
||||
end)
|
||||
describe('with errors', function()
|
||||
it('transforms API errors into lua errors', function()
|
||||
it('transforms API errors from nvim_buf_set_lines into lua errors', function()
|
||||
funcs.setline(1, {"abc", "def", "a\nb", "ttt"})
|
||||
eq({false, 'string cannot contain newlines'},
|
||||
funcs.luaeval('{pcall(vim.api.nvim_buf_set_lines, 1, 1, 2, false, {"b\\na"})}'))
|
||||
end)
|
||||
|
||||
it('transforms API errors from nvim_win_set_cursor into lua errors', function()
|
||||
funcs.setline(1, {"abc", "def", "a\nb", "ttt"})
|
||||
eq({false, 'Argument "pos" must be a [row, col] array'},
|
||||
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 1, {1, 2, 3})}'))
|
||||
end)
|
||||
end)
|
||||
|
||||
it('correctly evaluates API code which calls luaeval', function()
|
||||
|
||||
Reference in New Issue
Block a user