aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/has_spec.lua
diff options
context:
space:
mode:
authorAndrey Mishchenko <mishchea@gmail.com>2022-04-26 23:58:25 -0400
committerGitHub <noreply@github.com>2022-04-26 20:58:25 -0700
commit3933592338934933adfeb35dca8472bd28838ec8 (patch)
tree3257e73fb9af9f271145552618f8145ea27c8198 /test/functional/vimscript/has_spec.lua
parentd98e5357af1cd64b3e21196bc8e2408c724c0625 (diff)
downloadrneovim-3933592338934933adfeb35dca8472bd28838ec8.tar.gz
rneovim-3933592338934933adfeb35dca8472bd28838ec8.tar.bz2
rneovim-3933592338934933adfeb35dca8472bd28838ec8.zip
fix: has() should preserve v:shell_error #18280
fixes #18278
Diffstat (limited to 'test/functional/vimscript/has_spec.lua')
-rw-r--r--test/functional/vimscript/has_spec.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/functional/vimscript/has_spec.lua b/test/functional/vimscript/has_spec.lua
index c03fd13e0c..4d9b226434 100644
--- a/test/functional/vimscript/has_spec.lua
+++ b/test/functional/vimscript/has_spec.lua
@@ -68,4 +68,11 @@ describe('has()', function()
eq(0, funcs.has('wsl'))
end
end)
+
+ it('does not change v:shell_error', function()
+ local nvim_prog = helpers.nvim_prog
+ funcs.system({nvim_prog, '-es', '+73cquit'})
+ funcs.has('python3') -- use a call whose implementation shells out
+ eq(73, funcs.eval('v:shell_error'))
+ end)
end)