aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-04-20 17:44:13 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-04-23 18:17:04 +0200
commit052498ed42780a76daea589d063cd8947a894673 (patch)
treeb6c85416a4d7ced5eabb0a7a3866f5e0fee886cc /test/functional/ui/messages_spec.lua
parentc5af5c0b9ab84c86f84e32210512923e7eb641ba (diff)
downloadrneovim-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/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua38
1 files changed, 20 insertions, 18 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 9fa700c104..ca52a265fa 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1,25 +1,27 @@
-local t = require('test.functional.testutil')()
+local t = require('test.testutil')
+local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
-local clear, feed = t.clear, t.feed
-local eval = t.eval
+
+local clear, feed = n.clear, n.feed
+local eval = n.eval
local eq = t.eq
local neq = t.neq
-local command = t.command
-local set_method_error = t.set_method_error
-local api = t.api
-local async_meths = t.async_meths
+local command = n.command
+local set_method_error = n.set_method_error
+local api = n.api
+local async_meths = n.async_meths
local test_build_dir = t.paths.test_build_dir
-local nvim_prog = t.nvim_prog
-local testprg = t.testprg
-local exec = t.exec
-local exec_capture = t.exec_capture
-local exc_exec = t.exc_exec
-local exec_lua = t.exec_lua
-local poke_eventloop = t.poke_eventloop
-local assert_alive = t.assert_alive
+local nvim_prog = n.nvim_prog
+local testprg = n.testprg
+local exec = n.exec
+local exec_capture = n.exec_capture
+local exc_exec = n.exc_exec
+local exec_lua = n.exec_lua
+local poke_eventloop = n.poke_eventloop
+local assert_alive = n.assert_alive
local retry = t.retry
local is_os = t.is_os
-local fn = t.fn
+local fn = n.fn
local skip = t.skip
describe('ui/ext_messages', function()
@@ -2723,13 +2725,13 @@ end)
it('pager works in headless mode with UI attached', function()
skip(is_os('win'))
clear()
- local child_server = assert(t.new_pipename())
+ local child_server = assert(n.new_pipename())
fn.jobstart({ nvim_prog, '--clean', '--headless', '--listen', child_server })
retry(nil, nil, function()
neq(nil, vim.uv.fs_stat(child_server))
end)
- local child_session = t.connect(child_server)
+ local child_session = n.connect(child_server)
local child_screen = Screen.new(40, 6)
child_screen:attach(nil, child_session)
child_screen._default_attr_ids = nil -- TODO: unskip with new color scheme