aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-04-08 11:03:20 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-04-08 22:51:00 +0200
commit7035125b2b26aa68fcfb7cda39377ac79926a0f9 (patch)
treed194a3556a367b42505f9e7d26637e7cb3674928 /test/functional/ui
parent978962f9a00ce75216d2c36b79397ef3d2b54096 (diff)
downloadrneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.gz
rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.tar.bz2
rneovim-7035125b2b26aa68fcfb7cda39377ac79926a0f9.zip
test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
Diffstat (limited to 'test/functional/ui')
-rw-r--r--test/functional/ui/bufhl_spec.lua12
-rw-r--r--test/functional/ui/cmdline_highlight_spec.lua20
-rw-r--r--test/functional/ui/cmdline_spec.lua22
-rw-r--r--test/functional/ui/cursor_spec.lua18
-rw-r--r--test/functional/ui/decorations_spec.lua38
-rw-r--r--test/functional/ui/diff_spec.lua20
-rw-r--r--test/functional/ui/embed_spec.lua60
-rw-r--r--test/functional/ui/float_spec.lua44
-rw-r--r--test/functional/ui/fold_spec.lua18
-rw-r--r--test/functional/ui/highlight_spec.lua18
-rw-r--r--test/functional/ui/hlstate_spec.lua38
-rw-r--r--test/functional/ui/inccommand_spec.lua40
-rw-r--r--test/functional/ui/inccommand_user_spec.lua18
-rw-r--r--test/functional/ui/input_spec.lua22
-rw-r--r--test/functional/ui/linematch_spec.lua24
-rw-r--r--test/functional/ui/messages_spec.lua48
-rw-r--r--test/functional/ui/mode_spec.lua8
-rw-r--r--test/functional/ui/mouse_spec.lua20
-rw-r--r--test/functional/ui/multibyte_spec.lua18
-rw-r--r--test/functional/ui/multigrid_spec.lua16
-rw-r--r--test/functional/ui/options_spec.lua12
-rw-r--r--test/functional/ui/output_spec.lua43
-rw-r--r--test/functional/ui/popupmenu_spec.lua26
-rw-r--r--test/functional/ui/quickfix_spec.lua6
-rw-r--r--test/functional/ui/screen.lua16
-rw-r--r--test/functional/ui/screen_basic_spec.lua16
-rw-r--r--test/functional/ui/searchhl_spec.lua16
-rw-r--r--test/functional/ui/sign_spec.lua6
-rw-r--r--test/functional/ui/spell_spec.lua14
-rw-r--r--test/functional/ui/statuscolumn_spec.lua22
-rw-r--r--test/functional/ui/statusline_spec.lua24
-rw-r--r--test/functional/ui/syntax_conceal_spec.lua12
-rw-r--r--test/functional/ui/tabline_spec.lua10
-rw-r--r--test/functional/ui/title_spec.lua20
-rw-r--r--test/functional/ui/wildmode_spec.lua18
-rw-r--r--test/functional/ui/winbar_spec.lua20
36 files changed, 402 insertions, 401 deletions
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 896f75a681..e7f159437b 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -1,11 +1,11 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command, neq = helpers.command, helpers.neq
-local api = helpers.api
-local eq = helpers.eq
-local pcall_err = helpers.pcall_err
+local clear, feed, insert = t.clear, t.feed, t.insert
+local command, neq = t.command, t.neq
+local api = t.api
+local eq = t.eq
+local pcall_err = t.pcall_err
local set_virtual_text = api.nvim_buf_set_virtual_text
describe('Buffer highlighting', function()
diff --git a/test/functional/ui/cmdline_highlight_spec.lua b/test/functional/ui/cmdline_highlight_spec.lua
index 6c4000ba41..00c75c375f 100644
--- a/test/functional/ui/cmdline_highlight_spec.lua
+++ b/test/functional/ui/cmdline_highlight_spec.lua
@@ -1,15 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local eq = helpers.eq
-local feed = helpers.feed
-local clear = helpers.clear
-local api = helpers.api
-local fn = helpers.fn
-local source = helpers.source
-local exec_capture = helpers.exec_capture
-local dedent = helpers.dedent
-local command = helpers.command
+local eq = t.eq
+local feed = t.feed
+local clear = t.clear
+local api = t.api
+local fn = t.fn
+local source = t.source
+local exec_capture = t.exec_capture
+local dedent = t.dedent
+local command = t.command
local screen
diff --git a/test/functional/ui/cmdline_spec.lua b/test/functional/ui/cmdline_spec.lua
index 0b2c0af66b..a3d44f3542 100644
--- a/test/functional/ui/cmdline_spec.lua
+++ b/test/functional/ui/cmdline_spec.lua
@@ -1,15 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed = helpers.clear, helpers.feed
-local source = helpers.source
-local command = helpers.command
-local assert_alive = helpers.assert_alive
-local poke_eventloop = helpers.poke_eventloop
-local exec = helpers.exec
-local eval = helpers.eval
-local eq = helpers.eq
-local is_os = helpers.is_os
-local api = helpers.api
+local clear, feed = t.clear, t.feed
+local source = t.source
+local command = t.command
+local assert_alive = t.assert_alive
+local poke_eventloop = t.poke_eventloop
+local exec = t.exec
+local eval = t.eval
+local eq = t.eq
+local is_os = t.is_os
+local api = t.api
local function new_screen(opt)
local screen = Screen.new(25, 5)
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index cf6e342dcf..d4c23d45e2 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -1,8 +1,8 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, api = helpers.clear, helpers.api
-local eq = helpers.eq
-local command = helpers.command
+local clear, api = t.clear, t.api
+local eq = t.eq
+local command = t.command
describe('ui/cursor', function()
local screen
@@ -213,8 +213,8 @@ describe('ui/cursor', function()
}
-- Change the cursor style.
- helpers.command('hi Cursor guibg=DarkGray')
- helpers.command(
+ t.command('hi Cursor guibg=DarkGray')
+ t.command(
'set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr-o:hor20'
.. ',a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor'
.. ',sm:block-blinkwait175-blinkoff150-blinkon175'
@@ -260,8 +260,8 @@ describe('ui/cursor', function()
end)
-- Change hl groups only, should update the styles
- helpers.command('hi Cursor guibg=Red')
- helpers.command('hi lCursor guibg=Green')
+ t.command('hi Cursor guibg=Red')
+ t.command('hi lCursor guibg=Green')
-- Update the expected values.
for _, m in ipairs(expected_mode_info) do
@@ -280,7 +280,7 @@ describe('ui/cursor', function()
end)
-- update the highlight again to hide cursor
- helpers.command('hi Cursor blend=100')
+ t.command('hi Cursor blend=100')
for _, m in ipairs(expected_mode_info) do
if m.hl_id then
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 0fdbf5c6b1..924e4107db 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -1,18 +1,18 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local feed = helpers.feed
-local insert = helpers.insert
-local exec_lua = helpers.exec_lua
-local exec = helpers.exec
-local expect_events = helpers.expect_events
-local api = helpers.api
-local fn = helpers.fn
-local command = helpers.command
-local eq = helpers.eq
-local assert_alive = helpers.assert_alive
-local pcall_err = helpers.pcall_err
+local clear = t.clear
+local feed = t.feed
+local insert = t.insert
+local exec_lua = t.exec_lua
+local exec = t.exec
+local expect_events = t.expect_events
+local api = t.api
+local fn = t.fn
+local command = t.command
+local eq = t.eq
+local assert_alive = t.assert_alive
+local pcall_err = t.pcall_err
describe('decorations providers', function()
local screen
@@ -696,7 +696,7 @@ describe('decorations providers', function()
end
]]
- helpers.assert_alive()
+ t.assert_alive()
end)
it('supports subpriorities (order of definitions in a query file #27131)', function()
@@ -2411,7 +2411,7 @@ describe('extmark decorations', function()
|
]]}
- helpers.assert_alive()
+ t.assert_alive()
end)
it('priority ordering of overlay or win_col virtual text at same position', function()
@@ -5044,8 +5044,8 @@ l5
insert(example_test3)
feed 'gg'
- helpers.command('sign define Oldsign text=x')
- helpers.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
+ t.command('sign define Oldsign text=x')
+ t.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S1'})
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S2'})
@@ -5068,8 +5068,8 @@ l5
insert(example_test3)
feed 'gg'
- helpers.command('sign define Oldsign text=x')
- helpers.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
+ t.command('sign define Oldsign text=x')
+ t.command([[exe 'sign place 42 line=2 name=Oldsign buffer=' . bufnr('')]])
api.nvim_buf_set_extmark(0, ns, 0, -1, {sign_text='S1'})
api.nvim_buf_set_extmark(0, ns, 1, -1, {sign_text='S2'})
diff --git a/test/functional/ui/diff_spec.lua b/test/functional/ui/diff_spec.lua
index e0dfde35f2..7aab061dc3 100644
--- a/test/functional/ui/diff_spec.lua
+++ b/test/functional/ui/diff_spec.lua
@@ -1,15 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local feed = helpers.feed
-local clear = helpers.clear
-local command = helpers.command
-local insert = helpers.insert
-local write_file = helpers.write_file
-local dedent = helpers.dedent
-local exec = helpers.exec
-local eq = helpers.eq
-local api = helpers.api
+local feed = t.feed
+local clear = t.clear
+local command = t.command
+local insert = t.insert
+local write_file = t.write_file
+local dedent = t.dedent
+local exec = t.exec
+local eq = t.eq
+local api = t.api
before_each(clear)
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 5a8d6e1f62..49c808b5e6 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -1,21 +1,21 @@
local uv = vim.uv
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local api = helpers.api
-local feed = helpers.feed
-local eq = helpers.eq
-local neq = helpers.neq
-local clear = helpers.clear
-local ok = helpers.ok
-local fn = helpers.fn
-local nvim_prog = helpers.nvim_prog
-local retry = helpers.retry
-local write_file = helpers.write_file
-local assert_log = helpers.assert_log
-local check_close = helpers.check_close
-local is_os = helpers.is_os
+local api = t.api
+local feed = t.feed
+local eq = t.eq
+local neq = t.neq
+local clear = t.clear
+local ok = t.ok
+local fn = t.fn
+local nvim_prog = t.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 is_os = t.is_os
local testlog = 'Xtest-embed-log'
@@ -58,7 +58,7 @@ local function test_embed(ext_linegrid)
end)
it("doesn't erase output when setting color scheme", function()
- if helpers.is_os('openbsd') then
+ if t.is_os('openbsd') then
pending('FIXME #10804')
end
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
@@ -143,7 +143,7 @@ describe('--embed UI', function()
]]
if not is_os('win') then
- assert_log('Failed to get flags on descriptor 3: Bad file descriptor', testlog)
+ assert_log('Failed to get flags on descriptor 3: Bad file descriptor', testlog, 100)
end
end)
@@ -233,7 +233,7 @@ describe('--embed UI', function()
}
eq({ [16777215] = true }, seen)
- -- NB: by accident how functional/helpers.lua currently handles the default color scheme, the
+ -- NB: by accident how functional/t.lua currently handles the default color scheme, the
-- above is sufficient to test the behavior. But in case that workaround is removed, we need
-- a test with an explicit override like below, so do it to remain safe.
startup('--cmd', 'hi NORMAL guibg=#FF00FF')
@@ -253,44 +253,44 @@ describe('--embed UI', function()
screen:expect {
condition = function()
- eq(helpers.paths.test_source_path, screen.pwd)
+ eq(t.paths.test_source_path, screen.pwd)
end,
}
-- Change global cwd
- helpers.command(string.format('cd %s/src/nvim', helpers.paths.test_source_path))
+ t.command(string.format('cd %s/src/nvim', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(string.format('%s/src/nvim', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/src/nvim', t.paths.test_source_path), screen.pwd)
end,
}
-- Split the window and change the cwd in the split
- helpers.command('new')
- helpers.command(string.format('lcd %s/test', helpers.paths.test_source_path))
+ t.command('new')
+ t.command(string.format('lcd %s/test', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(string.format('%s/test', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/test', t.paths.test_source_path), screen.pwd)
end,
}
-- Move to the original window
- helpers.command('wincmd p')
+ t.command('wincmd p')
screen:expect {
condition = function()
- eq(string.format('%s/src/nvim', helpers.paths.test_source_path), screen.pwd)
+ eq(string.format('%s/src/nvim', t.paths.test_source_path), screen.pwd)
end,
}
-- Change global cwd again
- helpers.command(string.format('cd %s', helpers.paths.test_source_path))
+ t.command(string.format('cd %s', t.paths.test_source_path))
screen:expect {
condition = function()
- eq(helpers.paths.test_source_path, screen.pwd)
+ eq(t.paths.test_source_path, screen.pwd)
end,
}
end)
@@ -298,9 +298,9 @@ end)
describe('--embed --listen UI', function()
it('waits for connection on listening address', function()
- helpers.skip(helpers.is_os('win'))
+ t.skip(t.is_os('win'))
clear()
- local child_server = assert(helpers.new_pipename())
+ local child_server = assert(t.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 = helpers.connect(child_server)
+ local child_session = t.connect(child_server)
local info_ok, api_info = child_session:request('nvim_get_api_info')
ok(info_ok)
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index e83f3ff57e..79e62d487f 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -1,24 +1,24 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
local os = require('os')
-local clear, feed = helpers.clear, helpers.feed
-local assert_alive = helpers.assert_alive
-local command, feed_command = helpers.command, helpers.feed_command
-local eval = helpers.eval
-local eq = helpers.eq
-local neq = helpers.neq
-local expect = helpers.expect
-local exec = helpers.exec
-local exec_lua = helpers.exec_lua
-local insert = helpers.insert
-local api = helpers.api
-local fn = helpers.fn
-local run = helpers.run
-local pcall_err = helpers.pcall_err
+local clear, feed = t.clear, t.feed
+local assert_alive = t.assert_alive
+local command, feed_command = t.command, t.feed_command
+local eval = t.eval
+local eq = t.eq
+local neq = t.neq
+local expect = t.expect
+local exec = t.exec
+local exec_lua = t.exec_lua
+local insert = t.insert
+local api = t.api
+local fn = t.fn
+local run = t.run
+local pcall_err = t.pcall_err
local tbl_contains = vim.tbl_contains
-local curbuf = helpers.api.nvim_get_current_buf
-local curwin = helpers.api.nvim_get_current_win
-local curtab = helpers.api.nvim_get_current_tabpage
+local curbuf = t.api.nvim_get_current_buf
+local curwin = t.api.nvim_get_current_win
+local curtab = t.api.nvim_get_current_tabpage
local NIL = vim.NIL
describe('float window', function()
@@ -4080,7 +4080,7 @@ describe('float window', function()
if multigrid then
pending("supports second UI without multigrid", function()
- local session2 = helpers.connect(eval('v:servername'))
+ local session2 = t.connect(eval('v:servername'))
print(session2:request("nvim_eval", "2+2"))
local screen2 = Screen.new(40,7)
screen2:attach(nil, session2)
@@ -7978,7 +7978,7 @@ describe('float window', function()
end)
it("correctly redraws when overlaid windows are resized #13991", function()
- helpers.source([[
+ t.source([[
let popup_config = {"relative" : "editor",
\ "width" : 7,
\ "height" : 3,
@@ -8042,7 +8042,7 @@ describe('float window', function()
]])
end
- helpers.source([[
+ t.source([[
let new_popup_config = {"width" : 1, "height" : 3}
let new_border_config = {"width" : 3, "height" : 5}
@@ -8057,7 +8057,7 @@ describe('float window', function()
nnoremap zz <cmd>call Resize()<cr>
]])
- helpers.feed("zz")
+ t.feed("zz")
if multigrid then
screen:expect{grid=[[
## grid 1
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 7f13b6bd03..6bf019746d 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -1,13 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
-local command = helpers.command
-local feed_command = helpers.feed_command
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
-local exec = helpers.exec
-local assert_alive = helpers.assert_alive
+local clear, feed, eq = t.clear, t.feed, t.eq
+local command = t.command
+local feed_command = t.feed_command
+local insert = t.insert
+local fn = t.fn
+local api = t.api
+local exec = t.exec
+local assert_alive = t.assert_alive
local content1 = [[
This is a
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 57d0f2f590..c6f1a680e6 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -1,13 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
local os = require('os')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command, exec = helpers.command, helpers.exec
-local eval = helpers.eval
-local feed_command, eq = helpers.feed_command, helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local exec_lua = helpers.exec_lua
+local clear, feed, insert = t.clear, t.feed, t.insert
+local command, exec = t.command, t.exec
+local eval = t.eval
+local feed_command, eq = t.feed_command, t.eq
+local fn = t.fn
+local api = t.api
+local exec_lua = t.exec_lua
describe('colorscheme compatibility', function()
before_each(function()
@@ -2196,7 +2196,7 @@ describe("'winhighlight' highlight", function()
]],
}
- helpers.assert_alive()
+ t.assert_alive()
end)
it('can redraw statusline on cursor movement', function()
diff --git a/test/functional/ui/hlstate_spec.lua b/test/functional/ui/hlstate_spec.lua
index 8b36ad5431..bc380ecf91 100644
--- a/test/functional/ui/hlstate_spec.lua
+++ b/test/functional/ui/hlstate_spec.lua
@@ -1,13 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, insert = helpers.clear, helpers.insert
-local command = helpers.command
-local api = helpers.api
-local testprg = helpers.testprg
-local thelpers = require('test.functional.terminal.helpers')
-local skip = helpers.skip
-local is_os = helpers.is_os
+local clear, insert = t.clear, t.insert
+local command = t.command
+local api = t.api
+local testprg = t.testprg
+local tt = require('test.functional.terminal.testutil')
+local skip = t.skip
+local is_os = t.is_os
describe('ext_hlstate detailed highlights', function()
local screen
@@ -236,11 +236,11 @@ describe('ext_hlstate detailed highlights', function()
{7: }|
]])
- thelpers.feed_data('x ')
- thelpers.set_fg(45)
- thelpers.feed_data('y ')
- thelpers.set_bold()
- thelpers.feed_data('z\n')
+ tt.feed_data('x ')
+ tt.set_fg(45)
+ tt.feed_data('y ')
+ tt.set_bold()
+ tt.feed_data('z\n')
-- TODO(bfredl): check if this distinction makes sense
if is_os('win') then
screen:expect([[
@@ -260,8 +260,8 @@ describe('ext_hlstate detailed highlights', function()
]])
end
- thelpers.feed_termcode('[A')
- thelpers.feed_termcode('[2C')
+ tt.feed_termcode('[A')
+ tt.feed_termcode('[2C')
if is_os('win') then
screen:expect([[
^tty ready |
@@ -381,7 +381,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed('3ggV2jd')
+ t.feed('3ggV2jd')
--screen:redraw_debug()
screen:expect {
grid = [[
@@ -478,7 +478,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed('3ggV2jd')
+ t.feed('3ggV2jd')
--screen:redraw_debug()
screen:expect {
grid = [[
@@ -512,7 +512,7 @@ describe('ext_hlstate detailed highlights', function()
end
insert('last line')
- helpers.feed('gg')
+ t.feed('gg')
screen:expect {
grid = [[
^first line |
@@ -555,7 +555,7 @@ describe('ext_hlstate detailed highlights', function()
},
}
- helpers.feed(string.format('3ggV%ijd', num_lines - 2))
+ t.feed(string.format('3ggV%ijd', num_lines - 2))
--screen:redraw_debug(nil, nil, 100000)
local expected_ids = {}
diff --git a/test/functional/ui/inccommand_spec.lua b/test/functional/ui/inccommand_spec.lua
index d143c594f5..8f9cc868fc 100644
--- a/test/functional/ui/inccommand_spec.lua
+++ b/test/functional/ui/inccommand_spec.lua
@@ -1,22 +1,22 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local eval = helpers.eval
-local expect = helpers.expect
-local feed = helpers.feed
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
-local neq = helpers.neq
-local ok = helpers.ok
-local retry = helpers.retry
-local source = helpers.source
-local poke_eventloop = helpers.poke_eventloop
+local clear = t.clear
+local command = t.command
+local eq = t.eq
+local eval = t.eval
+local expect = t.expect
+local feed = t.feed
+local insert = t.insert
+local fn = t.fn
+local api = t.api
+local neq = t.neq
+local ok = t.ok
+local retry = t.retry
+local source = t.source
+local poke_eventloop = t.poke_eventloop
local sleep = vim.uv.sleep
-local testprg = helpers.testprg
-local assert_alive = helpers.assert_alive
+local testprg = t.testprg
+local assert_alive = t.assert_alive
local default_text = [[
Inc substitution on
@@ -1736,9 +1736,9 @@ describe("'inccommand' autocommands", function()
CmdwinLeave = {},
}
- local function bufferlist(t)
+ local function bufferlist(q)
local s = ''
- for _, buffer in pairs(t) do
+ for _, buffer in pairs(q) do
s = s .. ', ' .. tostring(buffer)
end
return s
@@ -2559,7 +2559,7 @@ describe(':substitute', function()
end)
it(':substitute with inccommand during :terminal activity', function()
- if helpers.skip_fragile(pending) then
+ if t.skip_fragile(pending) then
return
end
retry(2, 40000, function()
diff --git a/test/functional/ui/inccommand_user_spec.lua b/test/functional/ui/inccommand_user_spec.lua
index a714df72b7..0f95d2d856 100644
--- a/test/functional/ui/inccommand_user_spec.lua
+++ b/test/functional/ui/inccommand_user_spec.lua
@@ -1,13 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local api = helpers.api
-local clear = helpers.clear
-local eq = helpers.eq
-local exec_lua = helpers.exec_lua
-local insert = helpers.insert
-local feed = helpers.feed
-local command = helpers.command
-local assert_alive = helpers.assert_alive
+local api = t.api
+local clear = t.clear
+local eq = t.eq
+local exec_lua = t.exec_lua
+local insert = t.insert
+local feed = t.feed
+local command = t.command
+local assert_alive = t.assert_alive
-- Implements a :Replace command that works like :substitute and has multibuffer support.
local setup_replace_cmd = [[
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua
index 9c18127875..5d2ebb8c2e 100644
--- a/test/functional/ui/input_spec.lua
+++ b/test/functional/ui/input_spec.lua
@@ -1,14 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
-local clear, feed_command = helpers.clear, helpers.feed_command
-local feed, next_msg, eq = helpers.feed, helpers.next_msg, helpers.eq
-local command = helpers.command
-local expect = helpers.expect
-local curbuf_contents = helpers.curbuf_contents
-local api = helpers.api
-local exec_lua = helpers.exec_lua
-local write_file = helpers.write_file
-local fn = helpers.fn
-local eval = helpers.eval
+local t = require('test.functional.testutil')(after_each)
+local clear, feed_command = t.clear, t.feed_command
+local feed, next_msg, eq = t.feed, t.next_msg, t.eq
+local command = t.command
+local expect = t.expect
+local curbuf_contents = t.curbuf_contents
+local api = t.api
+local exec_lua = t.exec_lua
+local write_file = t.write_file
+local fn = t.fn
+local eval = t.eval
local Screen = require('test.functional.ui.screen')
before_each(clear)
diff --git a/test/functional/ui/linematch_spec.lua b/test/functional/ui/linematch_spec.lua
index 2733902615..c917b2c8f0 100644
--- a/test/functional/ui/linematch_spec.lua
+++ b/test/functional/ui/linematch_spec.lua
@@ -1,9 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local feed = helpers.feed
-local clear = helpers.clear
-local write_file = helpers.write_file
+local feed = t.feed
+local clear = t.clear
+local write_file = t.write_file
describe('Diff mode screen with 3 diffs open', function()
local fname = 'Xtest-functional-diff-screen-1'
@@ -1094,10 +1094,10 @@ describe('regressions', function()
screen = Screen.new(100, 20)
screen:attach()
-- line must be greater than MATCH_CHAR_MAX_LEN
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1000) .. 'hello' })
- helpers.exec 'vnew'
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1010) .. 'world' })
- helpers.exec 'windo diffthis'
+ t.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1000) .. 'hello' })
+ t.exec 'vnew'
+ t.api.nvim_buf_set_lines(0, 0, -1, false, { string.rep('a', 1010) .. 'world' })
+ t.exec 'windo diffthis'
end)
it('properly computes filler lines for hunks bigger than linematch limit', function()
@@ -1109,10 +1109,10 @@ describe('regressions', function()
for i = 0, 29 do
lines[#lines + 1] = tostring(i)
end
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, lines)
- helpers.exec 'vnew'
- helpers.api.nvim_buf_set_lines(0, 0, -1, false, { '00', '29' })
- helpers.exec 'windo diffthis'
+ t.api.nvim_buf_set_lines(0, 0, -1, false, lines)
+ t.exec 'vnew'
+ t.api.nvim_buf_set_lines(0, 0, -1, false, { '00', '29' })
+ t.exec 'windo diffthis'
feed('<C-e>')
screen:expect {
grid = [[
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 5faa2b95a9..f66c7da4d9 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1,26 +1,26 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed = helpers.clear, helpers.feed
-local eval = helpers.eval
-local eq = helpers.eq
-local neq = helpers.neq
-local command = helpers.command
-local set_method_error = helpers.set_method_error
-local api = helpers.api
-local async_meths = helpers.async_meths
-local test_build_dir = helpers.paths.test_build_dir
-local nvim_prog = helpers.nvim_prog
-local testprg = helpers.testprg
-local exec = helpers.exec
-local exec_capture = helpers.exec_capture
-local exc_exec = helpers.exc_exec
-local exec_lua = helpers.exec_lua
-local poke_eventloop = helpers.poke_eventloop
-local assert_alive = helpers.assert_alive
-local retry = helpers.retry
-local is_os = helpers.is_os
-local fn = helpers.fn
-local skip = helpers.skip
+local clear, feed = t.clear, t.feed
+local eval = t.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 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 retry = t.retry
+local is_os = t.is_os
+local fn = t.fn
+local skip = t.skip
describe('ui/ext_messages', function()
local screen
@@ -2683,13 +2683,13 @@ end)
it('pager works in headless mode with UI attached', function()
skip(is_os('win'))
clear()
- local child_server = assert(helpers.new_pipename())
+ local child_server = assert(t.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 = helpers.connect(child_server)
+ local child_session = t.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
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua
index 262b63977b..8b27d26217 100644
--- a/test/functional/ui/mode_spec.lua
+++ b/test/functional/ui/mode_spec.lua
@@ -1,9 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command = helpers.command
-local retry = helpers.retry
+local clear, feed, insert = t.clear, t.feed, t.insert
+local command = t.command
+local retry = t.retry
describe('ui mode_change event', function()
local screen
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua
index 11fb0ffaca..41507e754d 100644
--- a/test/functional/ui/mouse_spec.lua
+++ b/test/functional/ui/mouse_spec.lua
@@ -1,11 +1,11 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, api = helpers.clear, helpers.feed, helpers.api
-local insert, feed_command = helpers.insert, helpers.feed_command
-local eq, fn = helpers.eq, helpers.fn
-local poke_eventloop = helpers.poke_eventloop
-local command = helpers.command
-local exec = helpers.exec
+local clear, feed, api = t.clear, t.feed, t.api
+local insert, feed_command = t.insert, t.feed_command
+local eq, fn = t.eq, t.fn
+local poke_eventloop = t.poke_eventloop
+local command = t.command
+local exec = t.exec
describe('ui/mouse/input', function()
local screen
@@ -575,7 +575,7 @@ describe('ui/mouse/input', function()
:tabprevious |
]])
feed('<LeftMouse><10,0><LeftRelease>') -- go to second tab
- helpers.poke_eventloop()
+ t.poke_eventloop()
feed('<LeftMouse><0,1>')
screen:expect([[
{tab: + foo }{sel: + bar }{fill: }{tab:X}|
@@ -1856,8 +1856,8 @@ describe('ui/mouse/input', function()
it('feeding <MouseMove> in Normal mode does not use uninitialized memory #19480', function()
feed('<MouseMove>')
- helpers.poke_eventloop()
- helpers.assert_alive()
+ t.poke_eventloop()
+ t.assert_alive()
end)
it('mousemodel=popup_setpos', function()
diff --git a/test/functional/ui/multibyte_spec.lua b/test/functional/ui/multibyte_spec.lua
index 3149f8e8c6..0f3e6e6b6c 100644
--- a/test/functional/ui/multibyte_spec.lua
+++ b/test/functional/ui/multibyte_spec.lua
@@ -1,14 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local feed = helpers.feed
-local feed_command = helpers.feed_command
-local insert = helpers.insert
-local fn = helpers.fn
-local api = helpers.api
+local clear = t.clear
+local command = t.command
+local feed = t.feed
+local feed_command = t.feed_command
+local insert = t.insert
+local fn = t.fn
+local api = t.api
local split = vim.split
-local dedent = helpers.dedent
+local dedent = t.dedent
describe('multibyte rendering', function()
local screen
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index bb490546f6..20d3631930 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -1,12 +1,12 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local feed, command, insert = helpers.feed, helpers.command, helpers.insert
-local eq = helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local curwin = helpers.api.nvim_get_current_win
-local poke_eventloop = helpers.poke_eventloop
+local clear = t.clear
+local feed, command, insert = t.feed, t.command, t.insert
+local eq = t.eq
+local fn = t.fn
+local api = t.api
+local curwin = t.api.nvim_get_current_win
+local poke_eventloop = t.poke_eventloop
describe('ext_multigrid', function()
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 98af82a7c5..b1d10c28c4 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -1,10 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local shallowcopy = helpers.shallowcopy
-local eval = helpers.eval
+local clear = t.clear
+local command = t.command
+local eq = t.eq
+local shallowcopy = t.shallowcopy
+local eval = t.eval
describe('UI receives option updates', function()
local screen
diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua
index e2315ca7b4..b8a73b1c61 100644
--- a/test/functional/ui/output_spec.lua
+++ b/test/functional/ui/output_spec.lua
@@ -1,19 +1,20 @@
local Screen = require('test.functional.ui.screen')
-local helpers = require('test.functional.helpers')(after_each)
-local child_session = require('test.functional.terminal.helpers')
-local assert_alive = helpers.assert_alive
-local mkdir, write_file, rmdir = helpers.mkdir, helpers.write_file, helpers.rmdir
-local eq = helpers.eq
-local feed = helpers.feed
-local feed_command = helpers.feed_command
-local clear = helpers.clear
-local command = helpers.command
-local testprg = helpers.testprg
-local nvim_dir = helpers.nvim_dir
-local has_powershell = helpers.has_powershell
-local set_shell_powershell = helpers.set_shell_powershell
-local skip = helpers.skip
-local is_os = helpers.is_os
+local t = require('test.functional.testutil')(after_each)
+local tt = require('test.functional.terminal.testutil')
+
+local assert_alive = t.assert_alive
+local mkdir, write_file, rmdir = t.mkdir, t.write_file, t.rmdir
+local eq = t.eq
+local feed = t.feed
+local feed_command = t.feed_command
+local clear = t.clear
+local command = t.command
+local testprg = t.testprg
+local nvim_dir = t.nvim_dir
+local has_powershell = t.has_powershell
+local set_shell_powershell = t.set_shell_powershell
+local skip = t.skip
+local is_os = t.is_os
clear() -- for has_powershell()
@@ -21,7 +22,7 @@ describe('shell command :!', function()
local screen
before_each(function()
clear()
- screen = child_session.setup_child_nvim({
+ screen = tt.setup_child_nvim({
'-u',
'NONE',
'-i',
@@ -29,7 +30,7 @@ describe('shell command :!', function()
'--cmd',
'colorscheme vim',
'--cmd',
- helpers.nvim_set .. ' notermguicolors',
+ t.nvim_set .. ' notermguicolors',
})
screen:expect([[
{1: } |
@@ -40,14 +41,14 @@ describe('shell command :!', function()
end)
after_each(function()
- child_session.feed_data('\3') -- Ctrl-C
+ tt.feed_data('\3') -- Ctrl-C
end)
it('displays output without LF/EOF. #4646 #4569 #3772', function()
skip(is_os('win'))
-- NOTE: We use a child nvim (within a :term buffer)
-- to avoid triggering a UI flush.
- child_session.feed_data(':!printf foo; sleep 200\n')
+ tt.feed_data(':!printf foo; sleep 200\n')
screen:expect([[
|
{4:~ }|*2
@@ -61,7 +62,7 @@ describe('shell command :!', function()
it('throttles shell-command output greater than ~10KB', function()
skip(is_os('openbsd'), 'FIXME #10804')
skip(is_os('win'))
- child_session.feed_data((':!%s REP 30001 foo\n'):format(testprg('shell-test')))
+ tt.feed_data((':!%s REP 30001 foo\n'):format(testprg('shell-test')))
-- If we observe any line starting with a dot, then throttling occurred.
-- Avoid false failure on slow systems.
@@ -80,7 +81,7 @@ describe('shell command :!', function()
{3:-- TERMINAL --} |
]],
{
- -- test/functional/helpers.lua defaults to background=light.
+ -- test/functional/t.lua defaults to background=light.
[1] = { reverse = true },
[3] = { bold = true },
[10] = { foreground = 2 },
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index c1cb2b62be..9065e14c60 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1,17 +1,17 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local assert_alive = helpers.assert_alive
-local clear, feed = helpers.clear, helpers.feed
-local source = helpers.source
-local insert = helpers.insert
-local api = helpers.api
-local async_meths = helpers.async_meths
-local command = helpers.command
-local fn = helpers.fn
-local eq = helpers.eq
-local pcall_err = helpers.pcall_err
-local exec_lua = helpers.exec_lua
-local exec = helpers.exec
+local assert_alive = t.assert_alive
+local clear, feed = t.clear, t.feed
+local source = t.source
+local insert = t.insert
+local api = t.api
+local async_meths = t.async_meths
+local command = t.command
+local fn = t.fn
+local eq = t.eq
+local pcall_err = t.pcall_err
+local exec_lua = t.exec_lua
+local exec = t.exec
describe('ui/ext_popupmenu', function()
local screen
diff --git a/test/functional/ui/quickfix_spec.lua b/test/functional/ui/quickfix_spec.lua
index 40f8ef353a..d6c872b66e 100644
--- a/test/functional/ui/quickfix_spec.lua
+++ b/test/functional/ui/quickfix_spec.lua
@@ -1,7 +1,7 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, api = helpers.clear, helpers.feed, helpers.api
-local insert, command = helpers.insert, helpers.command
+local clear, feed, api = t.clear, t.feed, t.api
+local insert, command = t.insert, t.command
describe('quickfix selection highlight', function()
local screen
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index ab535afbf4..b08a5b93a6 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -70,17 +70,17 @@
-- To help write screen tests, see Screen:snapshot_util().
-- To debug screen tests, see Screen:redraw_debug().
-local helpers = require('test.functional.helpers')(nil)
+local t = require('test.functional.testutil')(nil)
local busted = require('busted')
local deepcopy = vim.deepcopy
-local shallowcopy = helpers.shallowcopy
-local concat_tables = helpers.concat_tables
+local shallowcopy = t.shallowcopy
+local concat_tables = t.concat_tables
local pesc = vim.pesc
-local run_session = helpers.run_session
-local eq = helpers.eq
-local dedent = helpers.dedent
-local get_session = helpers.get_session
-local create_callindex = helpers.create_callindex
+local run_session = t.run_session
+local eq = t.eq
+local dedent = t.dedent
+local get_session = t.get_session
+local create_callindex = t.create_callindex
local inspect = vim.inspect
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index adb1fd31f4..259baf725a 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -1,15 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local spawn, set_session, clear = helpers.spawn, helpers.set_session, helpers.clear
-local feed, command = helpers.feed, helpers.command
-local insert = helpers.insert
-local eq = helpers.eq
-local fn, api = helpers.fn, helpers.api
+local spawn, set_session, clear = t.spawn, t.set_session, t.clear
+local feed, command = t.feed, t.command
+local insert = t.insert
+local eq = t.eq
+local fn, api = t.fn, t.api
describe('screen', function()
local screen
local nvim_argv = {
- helpers.nvim_prog,
+ t.nvim_prog,
'-u',
'NONE',
'-i',
@@ -700,7 +700,7 @@ describe('Screen default colors', function()
local extra = (light and ' background=light') or ''
local nvim_argv = {
- helpers.nvim_prog,
+ t.nvim_prog,
'-u',
'NONE',
'-i',
diff --git a/test/functional/ui/searchhl_spec.lua b/test/functional/ui/searchhl_spec.lua
index cfc0f2f6de..592aea79c4 100644
--- a/test/functional/ui/searchhl_spec.lua
+++ b/test/functional/ui/searchhl_spec.lua
@@ -1,12 +1,12 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
-local command = helpers.command
-local feed_command = helpers.feed_command
-local eq = helpers.eq
-local eval = helpers.eval
-local fn = helpers.fn
-local testprg = helpers.testprg
+local clear, feed, insert = t.clear, t.feed, t.insert
+local command = t.command
+local feed_command = t.feed_command
+local eq = t.eq
+local eval = t.eval
+local fn = t.fn
+local testprg = t.testprg
describe('search highlighting', function()
local screen
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index 847a918dc9..a1a21dece3 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -1,7 +1,7 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local api, clear, eq = helpers.api, helpers.clear, helpers.eq
-local eval, exec, feed = helpers.eval, helpers.exec, helpers.feed
+local api, clear, eq = t.api, t.clear, t.eq
+local eval, exec, feed = t.eval, t.exec, t.feed
describe('Signs', function()
local screen
diff --git a/test/functional/ui/spell_spec.lua b/test/functional/ui/spell_spec.lua
index 8b5644ee42..4d960eb47c 100644
--- a/test/functional/ui/spell_spec.lua
+++ b/test/functional/ui/spell_spec.lua
@@ -1,13 +1,13 @@
-- Test for scenarios involving 'spell'
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local exec = helpers.exec
-local feed = helpers.feed
-local insert = helpers.insert
-local api = helpers.api
-local is_os = helpers.is_os
+local clear = t.clear
+local exec = t.exec
+local feed = t.feed
+local insert = t.insert
+local api = t.api
+local is_os = t.is_os
describe("'spell'", function()
local screen
diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua
index 289badb859..9d60e14bec 100644
--- a/test/functional/ui/statuscolumn_spec.lua
+++ b/test/functional/ui/statuscolumn_spec.lua
@@ -1,15 +1,15 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local eq = helpers.eq
-local exec = helpers.exec
-local eval = helpers.eval
-local exec_lua = helpers.exec_lua
-local feed = helpers.feed
-local api = helpers.api
-local pcall_err = helpers.pcall_err
-local assert_alive = helpers.assert_alive
+local clear = t.clear
+local command = t.command
+local eq = t.eq
+local exec = t.exec
+local eval = t.eval
+local exec_lua = t.exec_lua
+local feed = t.feed
+local api = t.api
+local pcall_err = t.pcall_err
+local assert_alive = t.assert_alive
local mousemodels = { 'extend', 'popup', 'popup_setpos' }
diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua
index 598dcab8d3..d359efbee9 100644
--- a/test/functional/ui/statusline_spec.lua
+++ b/test/functional/ui/statusline_spec.lua
@@ -1,17 +1,17 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local assert_alive = helpers.assert_alive
-local clear = helpers.clear
-local command = helpers.command
-local feed = helpers.feed
-local eq = helpers.eq
-local fn = helpers.fn
-local api = helpers.api
-local exec = helpers.exec
-local exec_lua = helpers.exec_lua
-local eval = helpers.eval
+local assert_alive = t.assert_alive
+local clear = t.clear
+local command = t.command
+local feed = t.feed
+local eq = t.eq
+local fn = t.fn
+local api = t.api
+local exec = t.exec
+local exec_lua = t.exec_lua
+local eval = t.eval
local sleep = vim.uv.sleep
-local pcall_err = helpers.pcall_err
+local pcall_err = t.pcall_err
local mousemodels = { 'extend', 'popup', 'popup_setpos' }
diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua
index ccf758bc07..c6109ad713 100644
--- a/test/functional/ui/syntax_conceal_spec.lua
+++ b/test/functional/ui/syntax_conceal_spec.lua
@@ -1,10 +1,10 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, command = helpers.clear, helpers.feed, helpers.command
-local eq = helpers.eq
-local insert = helpers.insert
-local poke_eventloop = helpers.poke_eventloop
-local exec = helpers.exec
+local clear, feed, command = t.clear, t.feed, t.command
+local eq = t.eq
+local insert = t.insert
+local poke_eventloop = t.poke_eventloop
+local exec = t.exec
describe('Screen', function()
local screen
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua
index c7cb0af826..dc9dc31295 100644
--- a/test/functional/ui/tabline_spec.lua
+++ b/test/functional/ui/tabline_spec.lua
@@ -1,9 +1,9 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, command, eq = helpers.clear, helpers.command, helpers.eq
-local insert = helpers.insert
-local api = helpers.api
-local assert_alive = helpers.assert_alive
+local clear, command, eq = t.clear, t.command, t.eq
+local insert = t.insert
+local api = t.api
+local assert_alive = t.assert_alive
describe('ui/ext_tabline', function()
local screen
diff --git a/test/functional/ui/title_spec.lua b/test/functional/ui/title_spec.lua
index 8060d3a460..bddf37d801 100644
--- a/test/functional/ui/title_spec.lua
+++ b/test/functional/ui/title_spec.lua
@@ -1,14 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local curwin = helpers.api.nvim_get_current_win
-local eq = helpers.eq
-local exec_lua = helpers.exec_lua
-local feed = helpers.feed
-local fn = helpers.fn
-local api = helpers.api
-local is_os = helpers.is_os
+local clear = t.clear
+local command = t.command
+local curwin = t.api.nvim_get_current_win
+local eq = t.eq
+local exec_lua = t.exec_lua
+local feed = t.feed
+local fn = t.fn
+local api = t.api
+local is_os = t.is_os
describe('title', function()
local screen
diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua
index 5b83a1c6aa..228942e964 100644
--- a/test/functional/ui/wildmode_spec.lua
+++ b/test/functional/ui/wildmode_spec.lua
@@ -1,13 +1,13 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear, feed, command = helpers.clear, helpers.feed, helpers.command
-local fn = helpers.fn
-local api = helpers.api
-local eq = helpers.eq
-local eval = helpers.eval
-local retry = helpers.retry
-local testprg = helpers.testprg
-local is_os = helpers.is_os
+local clear, feed, command = t.clear, t.feed, t.command
+local fn = t.fn
+local api = t.api
+local eq = t.eq
+local eval = t.eval
+local retry = t.retry
+local testprg = t.testprg
+local is_os = t.is_os
describe("'wildmenu'", function()
local screen
diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua
index f84f68f9e2..02e7f1d3f3 100644
--- a/test/functional/ui/winbar_spec.lua
+++ b/test/functional/ui/winbar_spec.lua
@@ -1,14 +1,14 @@
-local helpers = require('test.functional.helpers')(after_each)
+local t = require('test.functional.testutil')(after_each)
local Screen = require('test.functional.ui.screen')
-local clear = helpers.clear
-local command = helpers.command
-local insert = helpers.insert
-local api = helpers.api
-local eq = helpers.eq
-local poke_eventloop = helpers.poke_eventloop
-local feed = helpers.feed
-local fn = helpers.fn
-local pcall_err = helpers.pcall_err
+local clear = t.clear
+local command = t.command
+local insert = t.insert
+local api = t.api
+local eq = t.eq
+local poke_eventloop = t.poke_eventloop
+local feed = t.feed
+local fn = t.fn
+local pcall_err = t.pcall_err
describe('winbar', function()
local screen