From 3933592338934933adfeb35dca8472bd28838ec8 Mon Sep 17 00:00:00 2001 From: Andrey Mishchenko Date: Tue, 26 Apr 2022 23:58:25 -0400 Subject: fix: has() should preserve v:shell_error #18280 fixes #18278 --- test/functional/vimscript/has_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional/vimscript') 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) -- cgit