refactor(tests): drop os_kill #32401

Also change job tests to use `nvim` instead of random programs like `ping`.
This commit is contained in:
Justin M. Keyes
2025-02-11 07:19:46 -08:00
committed by GitHub
parent 891d2f4029
commit ac768996b2
4 changed files with 15 additions and 34 deletions

View File

@@ -12,7 +12,6 @@ local command = n.command
local insert = n.insert
local expect = n.expect
local exc_exec = n.exc_exec
local os_kill = n.os_kill
local pcall_err = t.pcall_err
local is_os = t.is_os
@@ -394,7 +393,7 @@ describe('system()', function()
it("with a program that doesn't close stdout will exit properly after passing input", function()
local out = eval(string.format("system('%s', 'clip-data')", testprg('streams-test')))
assert(out:sub(0, 5) == 'pid: ', out)
os_kill(out:match('%d+'))
eq(0, vim.uv.kill(assert(tonumber(out:match('%d+'))), 'sigkill'))
end)
end)
@@ -538,7 +537,7 @@ describe('systemlist()', function()
it("with a program that doesn't close stdout will exit properly after passing input", function()
local out = eval(string.format("systemlist('%s', 'clip-data')", testprg('streams-test')))
assert(out[1]:sub(0, 5) == 'pid: ', out)
os_kill(out[1]:match('%d+'))
eq(0, vim.uv.kill(assert(tonumber(out[1]:match('%d+'))), 'sigkill'))
end)
it('powershell w/ UTF-8 text #13713', function()