test: win: use "start" to test backgrounded job (#8171)

This commit is contained in:
Jan Edmund Lazo 2018-04-14 20:43:18 -04:00 committed by Justin M. Keyes
parent a7e7f7bd83
commit 5abfa94ed2

View File

@ -255,10 +255,8 @@ describe('system()', function()
end end
end) end)
it('to backgrounded command does not crash', function() it('to backgrounded command does not crash', function()
-- cmd.exe doesn't background a command with &
if iswin() then return end
-- This is indeterminate, just exercise the codepath. May get E5677. -- This is indeterminate, just exercise the codepath. May get E5677.
feed_command('call system("echo -n echoed &")') feed_command('call system(has("win32") ? "start /b /wait cmd /c echo echoed" : "echo -n echoed &")')
local v_errnum = string.match(eval("v:errmsg"), "^E%d*:") local v_errnum = string.match(eval("v:errmsg"), "^E%d*:")
if v_errnum then if v_errnum then
eq("E5677:", v_errnum) eq("E5677:", v_errnum)
@ -272,10 +270,8 @@ describe('system()', function()
eq("input", eval('system("cat -", "input")')) eq("input", eval('system("cat -", "input")'))
end) end)
it('to backgrounded command does not crash', function() it('to backgrounded command does not crash', function()
-- cmd.exe doesn't background a command with &
if iswin() then return end
-- This is indeterminate, just exercise the codepath. May get E5677. -- This is indeterminate, just exercise the codepath. May get E5677.
feed_command('call system("cat - &", "input")') feed_command('call system(has("win32") ? "start /b /wait more" : "cat - &", "input")')
local v_errnum = string.match(eval("v:errmsg"), "^E%d*:") local v_errnum = string.match(eval("v:errmsg"), "^E%d*:")
if v_errnum then if v_errnum then
eq("E5677:", v_errnum) eq("E5677:", v_errnum)