aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/job/job_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/job/job_spec.lua b/test/functional/job/job_spec.lua
index 76632c0fec..c1c559eb34 100644
--- a/test/functional/job/job_spec.lua
+++ b/test/functional/job/job_spec.lua
@@ -107,6 +107,20 @@ describe('jobs', function()
eq({'notification', 'exit', {0, 0}}, next_msg())
end)
+ it('can close the job streams with jobclose', function()
+ nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
+ nvim('command', 'call jobclose(j, "stdin")')
+ eq({'notification', 'exit', {0, 0}}, next_msg())
+ end)
+
+ it('wont allow jobsend with a job that closed stdin', function()
+ nvim('command', "let j = jobstart(['cat', '-'], g:job_opts)")
+ nvim('command', 'call jobclose(j, "stdin")')
+ eq(false, pcall(function()
+ nvim('command', 'call jobsend(j, ["some data"])')
+ end))
+ end)
+
it('will not allow jobsend/stop on a non-existent job', function()
eq(false, pcall(eval, "jobsend(-1, 'lol')"))
eq(false, pcall(eval, "jobstop(-1)"))