mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
functests: Check whether it is a problem with an array
This commit is contained in:
parent
a8ade2441d
commit
78082e8d3e
@ -29,17 +29,22 @@ describe('luaeval(vim.api.…)', function()
|
|||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
describe('with errors', function()
|
describe('with errors', function()
|
||||||
it('transforms API errors from nvim_buf_set_lines into lua errors', function()
|
it('transforms API error from nvim_buf_set_lines into lua error', function()
|
||||||
funcs.setline(1, {"abc", "def", "a\nb", "ttt"})
|
funcs.setline(1, {"abc", "def", "a\nb", "ttt"})
|
||||||
eq({false, 'string cannot contain newlines'},
|
eq({false, 'string cannot contain newlines'},
|
||||||
funcs.luaeval('{pcall(vim.api.nvim_buf_set_lines, 1, 1, 2, false, {"b\\na"})}'))
|
funcs.luaeval('{pcall(vim.api.nvim_buf_set_lines, 1, 1, 2, false, {"b\\na"})}'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('transforms API errors from nvim_win_set_cursor into lua errors', function()
|
it('transforms API error from nvim_win_set_cursor into lua error', function()
|
||||||
funcs.setline(1, {"abc", "def", "a\nb", "ttt"})
|
|
||||||
eq({false, 'Argument "pos" must be a [row, col] array'},
|
eq({false, 'Argument "pos" must be a [row, col] array'},
|
||||||
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 1, {1, 2, 3})}'))
|
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 1, {1, 2, 3})}'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('transforms API error from nvim_win_set_cursor + same array as in first test into lua error',
|
||||||
|
function()
|
||||||
|
eq({false, 'Argument "pos" must be a [row, col] array'},
|
||||||
|
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 1, {"b\\na"})}'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('correctly evaluates API code which calls luaeval', function()
|
it('correctly evaluates API code which calls luaeval', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user