aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/job/job_spec.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 85a1e92e38..07ca0c0058 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -37,7 +37,7 @@ describe('jobs', function()
end)
it('allows interactive commands', function()
- nvim('command', notify_str('v:job_data[1]', 'v:job_data[2]'))
+ nvim('command', notify_str('v:job_data[1]', 'get(v:job_data, 2)'))
nvim('command', "let j = jobstart('xxx', 'cat', ['-'])")
neq(0, eval('j'))
nvim('command', 'call jobsend(j, "abc\\n")')
@@ -46,9 +46,8 @@ describe('jobs', function()
eq({'notification', 'stdout', {{'123', 'xyz'}}}, next_message())
nvim('command', 'call jobsend(j, [123, "xyz"])')
eq({'notification', 'stdout', {{'123', 'xyz'}}}, next_message())
- nvim('command', notify_str('v:job_data[1])'))
nvim('command', "call jobstop(j)")
- eq({'notification', 'exit', {}}, next_message())
+ eq({'notification', 'exit', {0}}, next_message())
end)
it('preserves NULs', function()
@@ -59,9 +58,10 @@ describe('jobs', function()
file:close()
-- v:job_data preserves NULs.
- nvim('command', notify_str('v:job_data[1]', 'v:job_data[2]'))
+ nvim('command', notify_str('v:job_data[1]', 'get(v:job_data, 2)'))
nvim('command', "let j = jobstart('xxx', 'cat', ['"..filename.."'])")
eq({'notification', 'stdout', {{'abc\ndef'}}}, next_message())
+ eq({'notification', 'exit', {0}}, next_message())
os.remove(filename)
-- jobsend() preserves NULs.
@@ -72,12 +72,13 @@ describe('jobs', function()
end)
it('will hold data if it does not end in a newline', function()
- nvim('command', notify_str('v:job_data[1]', 'v:job_data[2]'))
+ nvim('command', notify_str('v:job_data[1]', 'get(v:job_data, 2)'))
nvim('command', "let j = jobstart('xxx', 'cat', ['-'])")
nvim('command', 'call jobsend(j, "abc\\nxyz")')
eq({'notification', 'stdout', {{'abc'}}}, next_message())
nvim('command', "call jobstop(j)")
eq({'notification', 'stdout', {{'xyz'}}}, next_message())
+ eq({'notification', 'exit', {0}}, next_message())
end)
it('will not allow jobsend/stop on a non-existent job', function()