aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-07-06 12:56:19 +0800
committerGitHub <noreply@github.com>2023-07-06 12:56:19 +0800
commit2afb04758c341e17c70b8d2e3869c901c8cdb7d2 (patch)
tree8a1fb611ce2319e552fe3331b58ffaa4712d652e
parent25e62697c32e43d978e43776f9a01cd62bfe83be (diff)
downloadrneovim-2afb04758c341e17c70b8d2e3869c901c8cdb7d2.tar.gz
rneovim-2afb04758c341e17c70b8d2e3869c901c8cdb7d2.tar.bz2
rneovim-2afb04758c341e17c70b8d2e3869c901c8cdb7d2.zip
fix(vim.system): close check handle (#24270)
Fix hang after running vim.system() with sanitizers.
-rw-r--r--runtime/lua/vim/_system.lua1
-rw-r--r--test/functional/api/vim_spec.lua4
-rw-r--r--test/functional/lua/ui_spec.lua4
3 files changed, 4 insertions, 5 deletions
diff --git a/runtime/lua/vim/_system.lua b/runtime/lua/vim/_system.lua
index eadf801a31..ff566866c0 100644
--- a/runtime/lua/vim/_system.lua
+++ b/runtime/lua/vim/_system.lua
@@ -287,6 +287,7 @@ function M.run(cmd, opts, on_exit)
end
end
check:stop()
+ check:close()
state.done = true
state.result = {
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 6f75de7f1b..617d0f12ff 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -440,7 +440,7 @@ describe('API', function()
eq({mode='n', blocking=false}, nvim("get_mode"))
end)
- it('Does not cause heap buffer overflow with large output', function()
+ it('does not cause heap buffer overflow with large output', function()
eq(eval('string(range(1000000))'),
nvim('command_output', 'echo range(1000000)'))
end)
@@ -4411,8 +4411,6 @@ describe('API', function()
eq('1', meths.cmd({cmd = 'echo', args = {true}}, {output = true}))
end)
describe('first argument as count', function()
- before_each(clear)
-
it('works', function()
command('vsplit | enew')
meths.cmd({cmd = 'bdelete', args = {meths.get_current_buf()}}, {})
diff --git a/test/functional/lua/ui_spec.lua b/test/functional/lua/ui_spec.lua
index d1b64419af..808b25d9ea 100644
--- a/test/functional/lua/ui_spec.lua
+++ b/test/functional/lua/ui_spec.lua
@@ -5,7 +5,7 @@ local exec_lua = helpers.exec_lua
local clear = helpers.clear
local feed = helpers.feed
local eval = helpers.eval
-local is_os = helpers.is_os
+local is_ci = helpers.is_ci
local poke_eventloop = helpers.poke_eventloop
describe('vim.ui', function()
@@ -134,7 +134,7 @@ describe('vim.ui', function()
describe('open()', function()
it('validation', function()
- if not is_os('bsd') then
+ if is_ci('github') then
matches('vim.ui.open: command failed %(%d%): { "[^"]+", "non%-existent%-file" }',
exec_lua[[local _, err = vim.ui.open('non-existent-file') ; return err]])
end