mirror of
https://github.com/neovim/neovim.git
synced 2025-11-22 10:06:33 +00:00
fix(vim.system): clear_env=true gives an invalid env to uv.spawn #33955
Problem: In setup_env, some needed logic is bypassed when clear_env=true. Solution: Drop the early return in setup_env(). Co-authored-by: BirdeeHub <birdee@localhost>
This commit is contained in:
@@ -73,6 +73,26 @@ describe('vim.system', function()
|
||||
eq('hellocat', system({ 'cat' }, { stdin = 'hellocat', text = true }).stdout)
|
||||
end)
|
||||
|
||||
it('can set environment', function()
|
||||
eq(
|
||||
'TESTVAL',
|
||||
system(
|
||||
{ n.testprg('printenv-test'), 'TEST' },
|
||||
{ env = { TEST = 'TESTVAL' }, text = true }
|
||||
).stdout
|
||||
)
|
||||
end)
|
||||
|
||||
it('can set environment with clear_env = true', function()
|
||||
eq(
|
||||
'TESTVAL',
|
||||
system(
|
||||
{ n.testprg('printenv-test'), 'TEST' },
|
||||
{ clear_env = true, env = { TEST = 'TESTVAL' }, text = true }
|
||||
).stdout
|
||||
)
|
||||
end)
|
||||
|
||||
it('supports timeout', function()
|
||||
eq({
|
||||
code = 124,
|
||||
|
||||
Reference in New Issue
Block a user