diff src/testdir/test_channel.vim @ 19362:7894f20668b1 v8.2.0239

patch 8.2.0239: MS-Windows: 'env' job option does not override existing vars Commit: https://github.com/vim/vim/commit/355757aed6ae2ae5446882570d89f243e4805937 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 10 22:06:32 2020 +0100 patch 8.2.0239: MS-Windows: 'env' job option does not override existing vars Problem: MS-Windows: 'env' job option does not override existing environment variables. (Tim Pope) Solution: Set the environment variables later. (Yasuhiro Matsumoto, closes #5485, closes #5608)
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Feb 2020 22:15:03 +0100
parents 16d538568dc8
children a5ac657fcd70
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -2006,3 +2006,12 @@ func Test_issue_5150()
   sleep 10m
   call assert_equal(-1, job_info(g:job).exitval)
 endfunc
+
+func Test_issue_5485()
+  let $VAR1 = 'global'
+  let g:Ch_reply = ""
+  let l:job = job_start([&shell, &shellcmdflag, has('win32') ? 'echo %VAR1% %VAR2%' : 'echo $VAR1 $VAR2'], {'env': {'VAR1': 'local', 'VAR2': 'local'}, 'callback': 'Ch_handler'})
+  let g:Ch_job = l:job
+  call WaitForAssert({-> assert_equal("local local", trim(g:Ch_reply))})
+  unlet $VAR1
+endfunc