mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
test: use termopen() instead of :terminal more (#26462)
This commit is contained in:
@@ -676,7 +676,7 @@ describe('jobs', function()
|
||||
on_stderr = function(chan, data, name) stderr = data end,
|
||||
on_stdout = function(chan, data, name) stdout = data end,
|
||||
}
|
||||
local j1 = vim.fn.jobstart({ vim.v.progpath, '-es', '-V1',( '+echo "%s="..getenv("%s")'):format(envname, envname), '+qa!' }, opt)
|
||||
local j1 = vim.fn.jobstart({ vim.v.progpath, '-es', '-V1',('+echo "%s="..getenv("%s")'):format(envname, envname), '+qa!' }, opt)
|
||||
vim.fn.jobwait({ j1 }, 10000)
|
||||
return join({ join(stdout), join(stderr) })
|
||||
]],
|
||||
@@ -1162,11 +1162,12 @@ describe("pty process teardown", function()
|
||||
it("does not prevent/delay exit. #4798 #4900", function()
|
||||
skip(is_os('win'))
|
||||
-- Use a nested nvim (in :term) to test without --headless.
|
||||
feed_command(":terminal '"..helpers.nvim_prog
|
||||
.."' -u NONE -i NONE --cmd '"..nvim_set.."' "
|
||||
funcs.termopen({
|
||||
helpers.nvim_prog, '-u', 'NONE', '-i', "NONE", '--cmd', nvim_set,
|
||||
-- Use :term again in the _nested_ nvim to get a PTY process.
|
||||
-- Use `sleep` to simulate a long-running child of the PTY.
|
||||
.."+terminal +'!(sleep 300 &)' +qa")
|
||||
'+terminal', '+!(sleep 300 &)', '+qa',
|
||||
}, { env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } })
|
||||
|
||||
-- Exiting should terminate all descendants (PTY, its children, ...).
|
||||
screen:expect([[
|
||||
|
||||
@@ -68,7 +68,9 @@ describe('command-line option', function()
|
||||
|
||||
-- Need to explicitly pipe to stdin so that the embedded Nvim instance doesn't try to read
|
||||
-- data from the terminal #18181
|
||||
funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " ")))
|
||||
funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " ")), {
|
||||
env = { VIMRUNTIME = os.getenv('VIMRUNTIME') }
|
||||
})
|
||||
screen:expect([[
|
||||
{1:^ }|
|
||||
{2:~ }|
|
||||
|
||||
Reference in New Issue
Block a user