mirror of
https://github.com/neovim/neovim.git
synced 2025-11-21 09:36:29 +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 eq = helpers.eq
|
||||
local eval = helpers.eval
|
||||
local feed = helpers.feed
|
||||
local nvim = helpers.nvim
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
local retry = helpers.retry
|
||||
|
||||
describe(':ls', function()
|
||||
@@ -14,7 +14,7 @@ describe(':ls', function()
|
||||
end)
|
||||
|
||||
it('R, F for :terminal buffers', function()
|
||||
nvim('set_option', 'shell', string.format('"%s" INTERACT', nvim_dir..'/shell-test'))
|
||||
nvim('set_option', 'shell', string.format('"%s" INTERACT', testprg('shell-test')))
|
||||
|
||||
command('edit foo')
|
||||
command('set hidden')
|
||||
|
||||
@@ -4,7 +4,7 @@ local eval = helpers.eval
|
||||
local has_powershell = helpers.has_powershell
|
||||
local matches = helpers.matches
|
||||
local nvim = helpers.nvim
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local testprg = helpers.testprg
|
||||
|
||||
describe(':make', function()
|
||||
clear()
|
||||
@@ -22,7 +22,7 @@ describe(':make', function()
|
||||
end)
|
||||
|
||||
it('captures stderr & non zero exit code #14349', function ()
|
||||
nvim('set_option', 'makeprg', nvim_dir..'/shell-test foo')
|
||||
nvim('set_option', 'makeprg', testprg('shell-test')..' foo')
|
||||
local out = eval('execute("make")')
|
||||
-- Make program exit code correctly captured
|
||||
matches('\nshell returned 3', out)
|
||||
@@ -31,7 +31,7 @@ describe(':make', function()
|
||||
end)
|
||||
|
||||
it('captures stderr & zero exit code #14349', function ()
|
||||
nvim('set_option', 'makeprg', nvim_dir..'/shell-test')
|
||||
nvim('set_option', 'makeprg', testprg('shell-test'))
|
||||
local out = eval('execute("make")')
|
||||
-- Ensure there are no "shell returned X" messages between
|
||||
-- command and last line (indicating zero exit)
|
||||
|
||||
Reference in New Issue
Block a user