aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/api_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-11 10:38:57 +0300
committerZyX <kp-pav@yandex.ru>2017-04-11 11:05:19 +0300
commit78082e8d3e54b4bee47d8a6c9ae2530a7e992dc9 (patch)
tree9e1d5a642d3d97daa2ab4d3660b4bca2d4623461 /test/functional/lua/api_spec.lua
parenta8ade2441d41289581628118a88c260c3ebb3fa5 (diff)
downloadrneovim-78082e8d3e54b4bee47d8a6c9ae2530a7e992dc9.tar.gz
rneovim-78082e8d3e54b4bee47d8a6c9ae2530a7e992dc9.tar.bz2
rneovim-78082e8d3e54b4bee47d8a6c9ae2530a7e992dc9.zip
functests: Check whether it is a problem with an array
Diffstat (limited to 'test/functional/lua/api_spec.lua')
-rw-r--r--test/functional/lua/api_spec.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/lua/api_spec.lua b/test/functional/lua/api_spec.lua
index 7dc7e962fb..a70e70b2b9 100644
--- a/test/functional/lua/api_spec.lua
+++ b/test/functional/lua/api_spec.lua
@@ -29,17 +29,22 @@ describe('luaeval(vim.api.…)', function()
end)
end)
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"})
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"})
+ it('transforms API error from nvim_win_set_cursor into lua error', function()
eq({false, 'Argument "pos" must be a [row, col] array'},
funcs.luaeval('{pcall(vim.api.nvim_win_set_cursor, 1, {1, 2, 3})}'))
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)
it('correctly evaluates API code which calls luaeval', function()