Use dict_T to pass env vars to process spawning code

Co-authored-by: Matthieu Coudron <mattator@gmail.com>
This commit is contained in:
James McCoy
2020-07-31 01:17:24 -04:00
parent 55add1c1c8
commit 7f50c69268
7 changed files with 135 additions and 65 deletions

View File

@@ -75,6 +75,20 @@ describe('jobs', function()
})
end)
it('append environment with pty #env', function()
nvim('command', "let $VAR = 'abc'")
nvim('command', "let g:job_opts.pty = v:true")
nvim('command', "let g:job_opts.env = {'TOTO': 'hello world'}")
if iswin() then
nvim('command', [[call jobstart('echo %TOTO% %VAR%', g:job_opts)]])
else
nvim('command', [[call jobstart('echo $TOTO $VAR', g:job_opts)]])
end
expect_msg_seq({
{'notification', 'stdout', {0, {'hello world abc', ''}}},
})
end)
it('replace environment #env', function()
nvim('command', "let $VAR = 'abc'")
nvim('command', "let g:job_opts.env = {'TOTO': 'hello world'}")