diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2021-05-19 15:35:30 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2021-05-19 16:35:02 +0200 |
commit | 9051064672f1c0d354c80a097a7ec501747c1f48 (patch) | |
tree | 22b2087acab86ae52b8a7805f39882f32e85cdf3 | |
parent | 34922fba6bf0cf75428d49e2c1a93f6b095727ca (diff) | |
download | rneovim-9051064672f1c0d354c80a097a7ec501747c1f48.tar.gz rneovim-9051064672f1c0d354c80a097a7ec501747c1f48.tar.bz2 rneovim-9051064672f1c0d354c80a097a7ec501747c1f48.zip |
test(lsp_spec): improve correctness
References https://github.com/neovim/neovim/issues/14571
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 13fc77d8d8..e956960dc7 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -9,6 +9,7 @@ local eq = helpers.eq local pcall_err = helpers.pcall_err local pesc = helpers.pesc local insert = helpers.insert +local funcs = helpers.funcs local retry = helpers.retry local NIL = helpers.NIL local read_file = require('test.helpers').read_file @@ -1880,14 +1881,15 @@ describe('LSP', function() end) it('adds current position to jumplist before jumping', function() - exec_lua([[ - vim.api.nvim_win_set_buf(0, ...) - vim.api.nvim_win_set_cursor(0, {2, 0}) - ]], default_target_bufnr) - jump(default_target_bufnr, location(default_target_uri, 0, 9, 0, 9)) + funcs.nvim_win_set_buf(0, target_bufnr) + local mark = funcs.nvim_buf_get_mark(target_bufnr, "'") + eq({ 1, 0 }, mark) + + funcs.nvim_win_set_cursor(0, {2, 3}) + jump(location(0, 9, 0, 9)) - local mark = exec_lua([[return vim.inspect(vim.api.nvim_buf_get_mark(..., "'"))]], default_target_bufnr) - eq('{ 2, 0 }', mark) + mark = funcs.nvim_buf_get_mark(target_bufnr, "'") + eq({ 2, 3 }, mark) end) end) |