mirror of
https://github.com/neovim/neovim.git
synced 2025-12-07 23:22:39 +00:00
refactor(tests): introduce testprg()
Also:
- Add a describe('shell :!') section to system_spec.
- Make the test for #16271 work on systems without powershell.
This commit is contained in:
@@ -5,7 +5,7 @@ local clear, insert = helpers.clear, helpers.insert
|
||||
local command = helpers.command
|
||||
local meths = helpers.meths
|
||||
local iswin = helpers.iswin
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
local thelpers = require('test.functional.terminal.helpers')
|
||||
|
||||
describe('ext_hlstate detailed highlights', function()
|
||||
@@ -191,7 +191,7 @@ describe('ext_hlstate detailed highlights', function()
|
||||
[6] = {{foreground = tonumber('0x40ffff'), fg_indexed=true}, {5, 1}},
|
||||
[7] = {{}, {{hi_name = "MsgArea", ui_name = "MsgArea", kind = "ui"}}},
|
||||
})
|
||||
command('enew | call termopen(["'..nvim_dir..'/tty-test"])')
|
||||
command(("enew | call termopen(['%s'])"):format(testprg('tty-test')))
|
||||
screen:expect([[
|
||||
^tty ready |
|
||||
{1: } |
|
||||
|
||||
@@ -17,7 +17,7 @@ local source = helpers.source
|
||||
local poke_eventloop = helpers.poke_eventloop
|
||||
local nvim = helpers.nvim
|
||||
local sleep = helpers.sleep
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
local assert_alive = helpers.assert_alive
|
||||
|
||||
local default_text = [[
|
||||
@@ -2875,7 +2875,7 @@ it(':substitute with inccommand during :terminal activity', function()
|
||||
clear()
|
||||
|
||||
command("set cmdwinheight=3")
|
||||
feed([[:terminal "]]..nvim_dir..[[/shell-test" REP 5000 xxx<cr>]])
|
||||
feed(([[:terminal "%s" REP 5000 xxx<cr>]]):format(testprg('shell-test')))
|
||||
command('file term')
|
||||
feed('G') -- Follow :terminal output.
|
||||
command('new')
|
||||
|
||||
@@ -9,6 +9,7 @@ local feed_command = helpers.feed_command
|
||||
local iswin = helpers.iswin
|
||||
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
|
||||
@@ -54,7 +55,7 @@ describe("shell command :!", function()
|
||||
if 'openbsd' == helpers.uname() then
|
||||
pending('FIXME #10804')
|
||||
end
|
||||
child_session.feed_data(":!"..nvim_dir.."/shell-test REP 30001 foo\n")
|
||||
child_session.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.
|
||||
@@ -207,12 +208,7 @@ describe("shell command :!", function()
|
||||
|
||||
it('handles multibyte sequences split over buffer boundaries', function()
|
||||
command('cd '..nvim_dir)
|
||||
local cmd
|
||||
if iswin() then
|
||||
cmd = '!shell-test UTF-8 '
|
||||
else
|
||||
cmd = '!./shell-test UTF-8'
|
||||
end
|
||||
local cmd = iswin() and '!shell-test UTF-8 ' or '!./shell-test UTF-8'
|
||||
feed_command(cmd)
|
||||
-- Note: only the first example of split composed char works
|
||||
screen:expect([[
|
||||
|
||||
@@ -5,7 +5,7 @@ local command = helpers.command
|
||||
local feed_command = helpers.feed_command
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
|
||||
describe('search highlighting', function()
|
||||
local screen
|
||||
@@ -305,7 +305,7 @@ describe('search highlighting', function()
|
||||
end)
|
||||
|
||||
it('is preserved during :terminal activity', function()
|
||||
feed([[:terminal "]]..nvim_dir..[[/shell-test" REP 5000 foo<cr>]])
|
||||
feed((':terminal "%s" REP 5000 foo<cr>'):format(testprg('shell-test')))
|
||||
|
||||
feed(':file term<CR>')
|
||||
feed('G') -- Follow :terminal output.
|
||||
|
||||
@@ -7,7 +7,7 @@ local meths = helpers.meths
|
||||
local eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local retry = helpers.retry
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
|
||||
describe("'wildmenu'", function()
|
||||
local screen
|
||||
@@ -114,7 +114,7 @@ describe("'wildmenu'", function()
|
||||
it('is preserved during :terminal activity', function()
|
||||
command('set wildmenu wildmode=full')
|
||||
command('set scrollback=4')
|
||||
feed([[:terminal "]]..nvim_dir..[[/shell-test" REP 5000 !terminal_output!<cr>]])
|
||||
feed((':terminal "%s" REP 5000 !terminal_output!<cr>'):format(testprg('shell-test')))
|
||||
feed('G') -- Follow :terminal output.
|
||||
feed([[:sign <Tab>]]) -- Invoke wildmenu.
|
||||
-- NB: in earlier versions terminal output was redrawn during cmdline mode.
|
||||
|
||||
Reference in New Issue
Block a user