From 3bb5d2f2192b63e368a4f573f66406eba3ee66b3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Dec 2023 08:00:27 +0800 Subject: test: use termopen() instead of :terminal more (#26462) --- test/functional/core/job_spec.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'test/functional/core/job_spec.lua') diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 038368c387..d2ea0b7441 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -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([[ -- cgit