diff options
author | James McCoy <jamessan@jamessan.com> | 2021-01-31 13:25:16 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 13:25:16 -0500 |
commit | e85c8dff692c894a614192f6dd8a4c71c1c9fe30 (patch) | |
tree | 077b5c54b39b538c09b44a419044648cc36fdce9 /test/functional | |
parent | b2713f11b48fe8029aeae07ef6a55ef182a4fbfd (diff) | |
parent | 81794204ce85dd15a62a27275fe717c7033e65d5 (diff) | |
download | rneovim-e85c8dff692c894a614192f6dd8a4c71c1c9fe30.tar.gz rneovim-e85c8dff692c894a614192f6dd8a4c71c1c9fe30.tar.bz2 rneovim-e85c8dff692c894a614192f6dd8a4c71c1c9fe30.zip |
Merge pull request #12937 from jamessan/term-env
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/core/job_spec.lua | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 6d1182478a..b59d87eb12 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -31,9 +31,9 @@ describe('jobs', function() nvim('set_var', 'channel', channel) source([[ function! Normalize(data) abort - " Windows: remove ^M + " Windows: remove ^M and term escape sequences return type([]) == type(a:data) - \ ? map(a:data, 'substitute(v:val, "\r", "", "g")') + \ ? map(a:data, 'substitute(substitute(v:val, "\r", "", "g"), "\x1b\\%(\\]\\d\\+;.\\{-}\x07\\|\\[.\\{-}[\x40-\x7E]\\)", "", "g")') \ : a:data endfunction function! OnEvent(id, data, event) dict @@ -63,6 +63,7 @@ describe('jobs', function() it('append environment #env', function() nvim('command', "let $VAR = 'abc'") + nvim('command', "let $TOTO = 'goodbye world'") nvim('command', "let g:job_opts.env = {'TOTO': 'hello world'}") if iswin() then nvim('command', [[call jobstart('echo %TOTO% %VAR%', g:job_opts)]]) @@ -75,8 +76,24 @@ describe('jobs', function() }) end) + it('append environment with pty #env', function() + nvim('command', "let $VAR = 'abc'") + nvim('command', "let $TOTO = 'goodbye world'") + 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 $TOTO = 'goodbye world'") nvim('command', "let g:job_opts.env = {'TOTO': 'hello world'}") nvim('command', "let g:job_opts.clear_env = 1") |