aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/helpers.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-01-12 13:11:28 +0000
committerLewis Russell <lewis6991@gmail.com>2024-01-12 17:53:27 +0000
commit4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (patch)
tree0cbb2cf8dac8b4f43109dc6f7a4051dfbea23f12 /test/functional/terminal/helpers.lua
parentc30f2e3182e3b50e7c03932027ac55edfc8ada4a (diff)
downloadrneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.tar.gz
rneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.tar.bz2
rneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.zip
test: normalise nvim bridge functions
- remove helpers.cur*meths - remove helpers.nvim
Diffstat (limited to 'test/functional/terminal/helpers.lua')
-rw-r--r--test/functional/terminal/helpers.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua
index babc2337fa..59af0ab167 100644
--- a/test/functional/terminal/helpers.lua
+++ b/test/functional/terminal/helpers.lua
@@ -5,7 +5,7 @@ local helpers = require('test.functional.helpers')(nil)
local Screen = require('test.functional.ui.screen')
local testprg = helpers.testprg
local exec_lua = helpers.exec_lua
-local nvim = helpers.nvim
+local meths = helpers.meths
local nvim_prog = helpers.nvim_prog
local function feed_data(data)
@@ -89,8 +89,8 @@ local function screen_setup(extra_rows, command, cols, env, screen_opts)
command = command and command or default_command
cols = cols and cols or 50
- nvim('command', 'highlight TermCursor cterm=reverse')
- nvim('command', 'highlight TermCursorNC ctermbg=11')
+ meths.nvim_command('highlight TermCursor cterm=reverse')
+ meths.nvim_command('highlight TermCursorNC ctermbg=11')
local screen = Screen.new(cols, 7 + extra_rows)
screen:set_default_attr_ids({
@@ -113,17 +113,17 @@ local function screen_setup(extra_rows, command, cols, env, screen_opts)
screen:attach(screen_opts or { rgb = false })
- nvim('command', 'enew')
- nvim('call_function', 'termopen', { command, env and { env = env } or nil })
- nvim('input', '<CR>')
- local vim_errmsg = nvim('eval', 'v:errmsg')
+ meths.nvim_command('enew')
+ meths.nvim_call_function('termopen', { command, env and { env = env } or nil })
+ meths.nvim_input('<CR>')
+ local vim_errmsg = meths.nvim_eval('v:errmsg')
if vim_errmsg and '' ~= vim_errmsg then
error(vim_errmsg)
end
- nvim('command', 'setlocal scrollback=10')
- nvim('command', 'startinsert')
- nvim('input', '<Ignore>') -- Add input to separate two RPC requests
+ meths.nvim_command('setlocal scrollback=10')
+ meths.nvim_command('startinsert')
+ meths.nvim_input('<Ignore>') -- Add input to separate two RPC requests
-- tty-test puts the terminal into raw mode and echoes input. Tests work by
-- feeding termcodes to control the display and asserting by screen:expect.
@@ -147,7 +147,7 @@ local function screen_setup(extra_rows, command, cols, env, screen_opts)
screen:expect(table.concat(expected, '|\n') .. '|')
else
-- This eval also acts as a poke_eventloop().
- if 0 == nvim('eval', "exists('b:terminal_job_id')") then
+ if 0 == meths.nvim_eval("exists('b:terminal_job_id')") then
error('terminal job failed to start')
end
end