aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/job_spec.lua23
1 files changed, 8 insertions, 15 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 73d437169a..5f39040a6f 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -60,7 +60,7 @@ describe('jobs', function()
it('changes to given / directory', function()
nvim('command', "let g:job_opts.cwd = '/'")
if iswin() then
- nvim('command', "let j = jobstart('pwd|%{$_.Path}', g:job_opts)")
+ nvim('command', "let j = jobstart('(Get-Location).Path', g:job_opts)")
else
nvim('command', "let j = jobstart('pwd', g:job_opts)")
end
@@ -75,7 +75,7 @@ describe('jobs', function()
mkdir(dir)
nvim('command', "let g:job_opts.cwd = '" .. dir .. "'")
if iswin() then
- nvim('command', "let j = jobstart('pwd|%{$_.Path}', g:job_opts)")
+ nvim('command', "let j = jobstart('(Get-Location).Path', g:job_opts)")
else
nvim('command', "let j = jobstart('pwd', g:job_opts)")
end
@@ -115,13 +115,13 @@ describe('jobs', function()
end)
it('returns -1 when target is not executable #5465', function()
- if helpers.pending_win32(pending) then return end
local function new_job()
return eval([[jobstart('')]])
end
local executable_jobid = new_job()
- local nonexecutable_jobid = eval(
- "jobstart(['./test/functional/fixtures/non_executable.txt'])")
+ local nonexecutable_jobid = eval("jobstart(['"..(iswin()
+ and './test/functional/fixtures'
+ or './test/functional/fixtures/non_executable.txt').."'])")
eq(-1, nonexecutable_jobid)
-- Should _not_ throw an error.
eq("", eval("v:errmsg"))
@@ -133,11 +133,10 @@ describe('jobs', function()
-- TODO: hangs on Windows
if helpers.pending_win32(pending) then return end
nvim('command', "let g:job_opts.on_stderr = function('OnEvent')")
- nvim('command', "call jobstart('echo', g:job_opts)")
+ nvim('command', [[call jobstart('echo ""', g:job_opts)]])
expect_twostreams({{'notification', 'stdout', {0, {'', ''}}},
{'notification', 'stdout', {0, {''}}}},
{{'notification', 'stderr', {0, {''}}}})
-
eq({'notification', 'exit', {0, 0}}, next_msg())
end)
@@ -253,7 +252,6 @@ describe('jobs', function()
end)
it('will not leak memory if we leave a job running', function()
- if helpers.pending_win32(pending) then return end -- TODO: Need `cat`.
nvim('command', "call jobstart(['cat', '-'], g:job_opts)")
end)
@@ -300,11 +298,7 @@ describe('jobs', function()
end)
it('can omit options', function()
- if helpers.pending_win32(pending) then return end
- neq(0, nvim('eval', 'delete(".Xtestjob")'))
- nvim('command', "call jobstart(['touch', '.Xtestjob'])")
- nvim('command', "sleep 100m")
- eq(0, nvim('eval', 'delete(".Xtestjob")'))
+ ok(eval([[jobstart('echo ""')]]) > 0)
end)
it('can omit data callbacks', function()
@@ -348,7 +342,6 @@ describe('jobs', function()
end)
it('can redefine callbacks being used by a job', function()
- if helpers.pending_win32(pending) then return end -- TODO: Need `cat`.
local screen = Screen.new()
screen:attach()
screen:set_default_attr_ids({
@@ -363,7 +356,7 @@ describe('jobs', function()
\ 'on_stderr': function('g:JobHandler'),
\ 'on_exit': function('g:JobHandler')
\ }
- let job = jobstart('cat -', g:callbacks)
+ let job = jobstart(['cat', '-'], g:callbacks)
]])
wait()
source([[