From c8d5e9230ee3ddc530ddb251fbe11e3b02293c80 Mon Sep 17 00:00:00 2001 From: Aaron Williamson Date: Thu, 24 Nov 2016 17:23:54 -0700 Subject: jobstart(): Return -1 if cmd is not executable. #5671 Closes #5465 --- test/functional/core/job_spec.lua | 6 ++++++ test/functional/fixtures/non_executable.txt | 1 + 2 files changed, 7 insertions(+) create mode 100644 test/functional/fixtures/non_executable.txt (limited to 'test') diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 9d24ba62db..61bd4f8b44 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -70,6 +70,12 @@ describe('jobs', function() 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")) + end) + it('invokes callbacks when the job writes and exits', function() nvim('command', "call jobstart(['echo'], g:job_opts)") eq({'notification', 'stdout', {0, {'', ''}}}, next_msg()) diff --git a/test/functional/fixtures/non_executable.txt b/test/functional/fixtures/non_executable.txt new file mode 100644 index 0000000000..cc27ecc664 --- /dev/null +++ b/test/functional/fixtures/non_executable.txt @@ -0,0 +1 @@ +This file is not an executable -- cgit