diff options
author | dundargoc <gocdundar@gmail.com> | 2024-04-20 17:44:13 +0200 |
---|---|---|
committer | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2024-04-23 18:17:04 +0200 |
commit | 052498ed42780a76daea589d063cd8947a894673 (patch) | |
tree | b6c85416a4d7ced5eabb0a7a3866f5e0fee886cc /test/functional/api/buffer_updates_spec.lua | |
parent | c5af5c0b9ab84c86f84e32210512923e7eb641ba (diff) | |
download | rneovim-052498ed42780a76daea589d063cd8947a894673.tar.gz rneovim-052498ed42780a76daea589d063cd8947a894673.tar.bz2 rneovim-052498ed42780a76daea589d063cd8947a894673.zip |
test: improve test conventions
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.
Closes https://github.com/neovim/neovim/issues/27004.
Diffstat (limited to 'test/functional/api/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/api/buffer_updates_spec.lua | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index 494bc4495b..e030b45396 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -1,10 +1,12 @@ -local t = require('test.functional.testutil')() -local clear = t.clear +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear local eq, ok = t.eq, t.ok -local fn = t.fn -local api = t.api -local command, eval, next_msg = t.command, t.eval, t.next_msg -local nvim_prog = t.nvim_prog +local fn = n.fn +local api = n.api +local command, eval, next_msg = n.command, n.eval, n.next_msg +local nvim_prog = n.nvim_prog local pcall_err = t.pcall_err local sleep = vim.uv.sleep local write_file = t.write_file @@ -511,11 +513,11 @@ describe('API: buffer events:', function() -- create several new sessions, in addition to our main API local sessions = {} - local pipe = t.new_pipename() + local pipe = n.new_pipename() eval("serverstart('" .. pipe .. "')") - sessions[1] = t.connect(pipe) - sessions[2] = t.connect(pipe) - sessions[3] = t.connect(pipe) + sessions[1] = n.connect(pipe) + sessions[2] = n.connect(pipe) + sessions[3] = n.connect(pipe) local function request(sessionnr, method, ...) local status, rv = sessions[sessionnr]:request(method, ...) @@ -814,7 +816,7 @@ describe('API: buffer events:', function() clear() sleep(250) -- response - eq(true, t.request('nvim_buf_attach', 0, false, {})) + eq(true, n.request('nvim_buf_attach', 0, false, {})) -- notification eq({ [1] = 'notification', |