aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/embed_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/embed_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/embed_spec.lua')
-rw-r--r--test/functional/ui/embed_spec.lua32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 934f00b288..e1abd43e20 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -1,20 +1,20 @@
-local uv = vim.uv
-
-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 uv = vim.uv
-local api = t.api
-local feed = t.feed
+local api = n.api
+local feed = n.feed
local eq = t.eq
local neq = t.neq
-local clear = t.clear
+local clear = n.clear
local ok = t.ok
-local fn = t.fn
-local nvim_prog = t.nvim_prog
+local fn = n.fn
+local nvim_prog = n.nvim_prog
local retry = t.retry
local write_file = t.write_file
local assert_log = t.assert_log
-local check_close = t.check_close
+local check_close = n.check_close
local is_os = t.is_os
local testlog = 'Xtest-embed-log'
@@ -258,7 +258,7 @@ describe('--embed UI', function()
}
-- Change global cwd
- t.command(string.format('cd %s/src/nvim', t.paths.test_source_path))
+ n.command(string.format('cd %s/src/nvim', t.paths.test_source_path))
screen:expect {
condition = function()
@@ -267,8 +267,8 @@ describe('--embed UI', function()
}
-- Split the window and change the cwd in the split
- t.command('new')
- t.command(string.format('lcd %s/test', t.paths.test_source_path))
+ n.command('new')
+ n.command(string.format('lcd %s/test', t.paths.test_source_path))
screen:expect {
condition = function()
@@ -277,7 +277,7 @@ describe('--embed UI', function()
}
-- Move to the original window
- t.command('wincmd p')
+ n.command('wincmd p')
screen:expect {
condition = function()
@@ -286,7 +286,7 @@ describe('--embed UI', function()
}
-- Change global cwd again
- t.command(string.format('cd %s', t.paths.test_source_path))
+ n.command(string.format('cd %s', t.paths.test_source_path))
screen:expect {
condition = function()
@@ -300,7 +300,7 @@ describe('--embed --listen UI', function()
it('waits for connection on listening address', function()
t.skip(t.is_os('win'))
clear()
- local child_server = assert(t.new_pipename())
+ local child_server = assert(n.new_pipename())
fn.jobstart({
nvim_prog,
'--embed',
@@ -314,7 +314,7 @@ describe('--embed --listen UI', function()
neq(nil, uv.fs_stat(child_server))
end)
- local child_session = t.connect(child_server)
+ local child_session = n.connect(child_server)
local info_ok, api_info = child_session:request('nvim_get_api_info')
ok(info_ok)