aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/system_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:15:05 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:27:38 +0000
commitc5d770d311841ea5230426cc4c868e8db27300a8 (patch)
treedd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/functional/lua/system_spec.lua
parent9be89f131f87608f224f0ee06d199fcd09d32176 (diff)
parent081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff)
downloadrneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/lua/system_spec.lua')
-rw-r--r--test/functional/lua/system_spec.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/functional/lua/system_spec.lua b/test/functional/lua/system_spec.lua
index 482bfcf1a9..afbada007d 100644
--- a/test/functional/lua/system_spec.lua
+++ b/test/functional/lua/system_spec.lua
@@ -9,7 +9,7 @@ local function system_sync(cmd, opts)
return exec_lua(function()
local obj = vim.system(cmd, opts)
- if opts.timeout then
+ if opts and opts.timeout then
-- Minor delay before calling wait() so the timeout uv timer can have a headstart over the
-- internal call to vim.wait() in wait().
vim.wait(10)
@@ -75,7 +75,7 @@ describe('vim.system', function()
it('kill processes', function()
exec_lua(function()
- local signal
+ local signal --- @type integer?
local cmd = vim.system({ 'cat', '-' }, { stdin = true }, function(r)
signal = r.signal
end) -- run forever
@@ -112,4 +112,12 @@ describe('vim.system', function()
)
eq(true, exec_lua([[return _G.processed]]))
end)
+
+ if t.is_os('win') then
+ it('can resolve windows command extentions.', function()
+ t.write_file('test.bat', 'echo hello world')
+ system_sync({ 'chmod', '+x', 'test.bat' })
+ system_sync({ './test' })
+ end)
+ end
end)