diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-12-10 15:50:08 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-12-11 01:14:22 +0100 |
commit | d32888073f07326550b32ed6b497260aef19ec1e (patch) | |
tree | e5189bc3a7b4540d34cba8aa14641f46e6ac6d54 /test | |
parent | c8d5e9230ee3ddc530ddb251fbe11e3b02293c80 (diff) | |
download | rneovim-d32888073f07326550b32ed6b497260aef19ec1e.tar.gz rneovim-d32888073f07326550b32ed6b497260aef19ec1e.tar.bz2 rneovim-d32888073f07326550b32ed6b497260aef19ec1e.zip |
test: jobstart()
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/core/job_spec.lua | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 61bd4f8b44..79cc877cac 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -65,15 +65,22 @@ describe('jobs', function() end) it('returns 0 when it fails to start', function() - local status, rv = pcall(eval, "jobstart([])") - eq(false, status) - ok(rv ~= nil) - end) - - it('returns -1 when target is not executable', function() - local rv = eval("jobstart(['./test/functional/fixtures/non_executable.txt'])") - eq(-1, rv) eq("", eval("v:errmsg")) + execute("let g:test_jobid = jobstart([])") + eq(0, eval("g:test_jobid")) + eq("E474:", string.match(eval("v:errmsg"), "E%d*:")) + end) + + it('returns -1 when target is not executable #5465', function() + local function new_job() return eval([[jobstart(['echo', 'foo'])]]) end + local executable_jobid = new_job() + local nonexecutable_jobid = eval( + "jobstart(['./test/functional/fixtures/non_executable.txt'])") + eq(-1, nonexecutable_jobid) + -- Should _not_ throw an error. + eq("", eval("v:errmsg")) + -- Non-executable job should not increment the job ids. #5465 + eq(executable_jobid + 1, new_job()) end) it('invokes callbacks when the job writes and exits', function() |