diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-01-08 09:32:49 -0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2020-01-08 09:41:41 -0800 |
commit | 8c8681d594a10c7056d62d09267190b6fab37e85 (patch) | |
tree | e7b2206ba66f6b52d66a3cb4b63b60470f63e426 | |
parent | 844cd9cef12d77fd5d0bb14819dbe201dbf68f0b (diff) | |
download | rneovim-8c8681d594a10c7056d62d09267190b6fab37e85.tar.gz rneovim-8c8681d594a10c7056d62d09267190b6fab37e85.tar.bz2 rneovim-8c8681d594a10c7056d62d09267190b6fab37e85.zip |
test: hoist buf_lines()
-rw-r--r-- | test/functional/helpers.lua | 5 | ||||
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 0fdfcd70ba..e0012c6ced 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -559,6 +559,11 @@ function module.wait() session:request('nvim_eval', '1') end +function module.buf_lines(bufnr) + return module.exec_lua("return vim.api.nvim_buf_get_lines((...), 0, -1, false)", bufnr) +end + +--@see buf_lines() function module.curbuf_contents() module.wait() -- Before inspecting the buffer, process all input. return table.concat(module.curbuf('get_lines', 0, -1, true), '\n') diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 803483c0ef..45452c0b20 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -729,10 +729,6 @@ describe('LSP util', function() } end - local function buf_lines(bufnr) - return exec_lua("return vim.api.nvim_buf_get_lines((...), 0, -1, false)", bufnr) - end - describe('apply_edits', function() it('should apply simple edits', function() local edits = { |