aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core/job_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/job_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/job_spec.lua')
-rw-r--r--test/functional/core/job_spec.lua53
1 files changed, 27 insertions, 26 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index f8144e9c05..e1efc07452 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_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 tt = require('test.functional.terminal.testutil')
-local clear = t.clear
+local clear = n.clear
local eq = t.eq
-local eval = t.eval
-local exc_exec = t.exc_exec
-local feed_command = t.feed_command
-local feed = t.feed
-local insert = t.insert
+local eval = n.eval
+local exc_exec = n.exc_exec
+local feed_command = n.feed_command
+local feed = n.feed
+local insert = n.insert
local neq = t.neq
-local next_msg = t.next_msg
-local testprg = t.testprg
+local next_msg = n.next_msg
+local testprg = n.testprg
local ok = t.ok
-local source = t.source
+local source = n.source
local write_file = t.write_file
local mkdir = t.mkdir
-local rmdir = t.rmdir
-local assert_alive = t.assert_alive
-local command = t.command
-local fn = t.fn
-local os_kill = t.os_kill
+local rmdir = n.rmdir
+local assert_alive = n.assert_alive
+local command = n.command
+local fn = n.fn
+local os_kill = n.os_kill
local retry = t.retry
-local api = t.api
+local api = n.api
local NIL = vim.NIL
-local poke_eventloop = t.poke_eventloop
-local get_pathsep = t.get_pathsep
-local pathroot = t.pathroot
-local exec_lua = t.exec_lua
-local nvim_set = t.nvim_set
-local expect_twostreams = t.expect_twostreams
-local expect_msg_seq = t.expect_msg_seq
+local poke_eventloop = n.poke_eventloop
+local get_pathsep = n.get_pathsep
+local pathroot = n.pathroot
+local exec_lua = n.exec_lua
+local nvim_set = n.nvim_set
+local expect_twostreams = n.expect_twostreams
+local expect_msg_seq = n.expect_msg_seq
local pcall_err = t.pcall_err
local matches = t.matches
-local Screen = require('test.functional.ui.screen')
local skip = t.skip
local is_os = t.is_os
@@ -732,7 +733,7 @@ describe('jobs', function()
describe('jobwait()', function()
before_each(function()
if is_os('win') then
- t.set_shell_powershell()
+ n.set_shell_powershell()
end
end)
@@ -1239,7 +1240,7 @@ describe('pty process teardown', function()
skip(fn.executable('sleep') == 0, 'missing "sleep" command')
-- Use a nested nvim (in :term) to test without --headless.
fn.termopen({
- t.nvim_prog,
+ n.nvim_prog,
'-u',
'NONE',
'-i',