aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTommy Allen <tommy@esdf.io>2018-11-07 04:31:25 -0500
committerJustin M. Keyes <justinkz@gmail.com>2018-11-07 10:31:25 +0100
commitc4c74c3883aa3122c0c877ca8dd7b26beb5cc4aa (patch)
tree41eab89a4dda67634836178f4b374ab35630bb92 /test
parent769d164c70bee1877d101447ba41730147a2f127 (diff)
downloadrneovim-c4c74c3883aa3122c0c877ca8dd7b26beb5cc4aa.tar.gz
rneovim-c4c74c3883aa3122c0c877ca8dd7b26beb5cc4aa.tar.bz2
rneovim-c4c74c3883aa3122c0c877ca8dd7b26beb5cc4aa.zip
jobstart(): Fix hang on non-executable cwd #9204
* os/fs.c: add os_isdir_executable() * eval.c: fix hang on job start caused by non-executable cwd option * channel.c: assert cwd is an executable directory * test: jobstart() produces error when using non-executable cwd
Diffstat (limited to 'test')
-rw-r--r--test/functional/core/job_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 34168e10c2..eb02610df0 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -17,6 +17,7 @@ local pathroot = helpers.pathroot
local nvim_set = helpers.nvim_set
local expect_twostreams = helpers.expect_twostreams
local expect_msg_seq = helpers.expect_msg_seq
+local expect_err = helpers.expect_err
local Screen = require('test.functional.ui.screen')
-- Kill process with given pid
@@ -115,6 +116,17 @@ describe('jobs', function()
ok(string.find(err, "E475: Invalid argument: expected valid directory$") ~= nil)
end)
+ it('produces error when using non-executable `cwd`', function()
+ if iswin() then return end -- N/A for Windows
+
+ local dir = 'Xtest_not_executable_dir'
+ mkdir(dir)
+ funcs.setfperm(dir, 'rw-------')
+ expect_err('E475: Invalid argument: expected valid directory$', nvim,
+ 'command', "call jobstart('pwd', {'cwd': '" .. dir .. "'})")
+ rmdir(dir)
+ end)
+
it('returns 0 when it fails to start', function()
eq("", eval("v:errmsg"))
feed_command("let g:test_jobid = jobstart([])")