aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/startup_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/core/startup_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/core/startup_spec.lua')
-rw-r--r--test/functional/core/startup_spec.lua43
1 files changed, 22 insertions, 21 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua
index e98b1bdd87..a53625ab1b 100644
--- a/test/functional/core/startup_spec.lua
+++ b/test/functional/core/startup_spec.lua
@@ -1,38 +1,39 @@
-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 assert_alive = t.assert_alive
+local assert_alive = n.assert_alive
local assert_log = t.assert_log
-local clear = t.clear
-local command = t.command
+local clear = n.clear
+local command = n.command
local ok = t.ok
local eq = t.eq
local matches = t.matches
-local eval = t.eval
-local exec = t.exec
-local exec_capture = t.exec_capture
-local exec_lua = t.exec_lua
-local feed = t.feed
-local fn = t.fn
+local eval = n.eval
+local exec = n.exec
+local exec_capture = n.exec_capture
+local exec_lua = n.exec_lua
+local feed = n.feed
+local fn = n.fn
local pesc = vim.pesc
local mkdir = t.mkdir
-local mkdir_p = t.mkdir_p
-local nvim_prog = t.nvim_prog
-local nvim_set = t.nvim_set
+local mkdir_p = n.mkdir_p
+local nvim_prog = n.nvim_prog
+local nvim_set = n.nvim_set
local read_file = t.read_file
local retry = t.retry
-local rmdir = t.rmdir
+local rmdir = n.rmdir
local sleep = vim.uv.sleep
local startswith = vim.startswith
local write_file = t.write_file
-local api = t.api
-local alter_slashes = t.alter_slashes
+local api = n.api
+local alter_slashes = n.alter_slashes
local is_os = t.is_os
local dedent = t.dedent
local tbl_map = vim.tbl_map
local tbl_filter = vim.tbl_filter
local endswith = vim.endswith
-local check_close = t.check_close
+local check_close = n.check_close
local testlog = 'Xtest-startupspec-log'
@@ -994,7 +995,7 @@ describe('sysinit', function()
local xdgdir = 'Xxdg'
local vimdir = 'Xvim'
local xhome = 'Xhome'
- local pathsep = t.get_pathsep()
+ local pathsep = n.get_pathsep()
before_each(function()
rmdir(xdgdir)
@@ -1055,7 +1056,7 @@ end)
describe('user config init', function()
local xhome = 'Xhome'
- local pathsep = t.get_pathsep()
+ local pathsep = n.get_pathsep()
local xconfig = xhome .. pathsep .. 'Xconfig'
local xdata = xhome .. pathsep .. 'Xdata'
local init_lua_path = table.concat({ xconfig, 'nvim', 'init.lua' }, pathsep)
@@ -1218,7 +1219,7 @@ end)
describe('runtime:', function()
local xhome = 'Xhome'
- local pathsep = t.get_pathsep()
+ local pathsep = n.get_pathsep()
local xconfig = xhome .. pathsep .. 'Xconfig'
local xdata = xhome .. pathsep .. 'Xdata'
local xenv = { XDG_CONFIG_HOME = xconfig, XDG_DATA_HOME = xdata }
@@ -1360,7 +1361,7 @@ end)
describe('user session', function()
local xhome = 'Xhome'
- local pathsep = t.get_pathsep()
+ local pathsep = n.get_pathsep()
local session_file = table.concat({ xhome, 'session.lua' }, pathsep)
before_each(function()