aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-03-28 11:40:25 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-03-29 20:35:44 -0300
commitb8b9e5ebade4d88840177154338cb99db5c7fbab (patch)
treee9e886394d5dbc260135df4b41b770fddb4e5b6a /test
parent028f6d7d3f822dd620873a2a51c2d68ab1ef0b95 (diff)
downloadrneovim-b8b9e5ebade4d88840177154338cb99db5c7fbab.tar.gz
rneovim-b8b9e5ebade4d88840177154338cb99db5c7fbab.tar.bz2
rneovim-b8b9e5ebade4d88840177154338cb99db5c7fbab.zip
eval: Implement `jobclose()` vimscript function
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)"))