test(old): make getting an unused PID work (#22529)

This commit is contained in:
zeertzjq 2023-03-05 08:34:58 +08:00 committed by GitHub
parent 089f962d6a
commit b44b8e7687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -435,6 +435,12 @@ func s:get_unused_pid(base)
if job_status(j) ==# 'dead'
return job_info(j).process
endif
elseif has('nvim')
let j = jobstart('echo')
let pid = jobpid(j)
if jobwait([j])[0] >= 0
return pid
endif
endif
" Must add four for MS-Windows to see it as a different one.
return a:base + 4