aboutsummaryrefslogtreecommitdiff
path: root/test/functional/core
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2021-05-20 21:15:31 +0800
committerkevinhwang91 <kevin.hwang@live.com>2021-05-20 21:15:31 +0800
commitd29148ffd812058cf7281607d1b6a9dd937d5d6c (patch)
tree8dc16d1b0949b0093a3fd71991ac3ed438fca4d6 /test/functional/core
parent2dc0f812710b19f8befcfa64ef9335cadc510296 (diff)
parent5d9c5601275abfa17396b3a80c7b958c48080807 (diff)
downloadrneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.tar.gz
rneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.tar.bz2
rneovim-d29148ffd812058cf7281607d1b6a9dd937d5d6c.zip
Merge remote-tracking branch 'origin/master' into qftf
Diffstat (limited to 'test/functional/core')
-rw-r--r--test/functional/core/job_spec.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 9de0d08e79..34ab90d760 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -118,6 +118,32 @@ describe('jobs', function()
end
end)
+ it('handles case-insensitively matching #env vars', function()
+ nvim('command', "let $TOTO = 'abc'")
+ -- Since $Toto is being set in the job, it should take precedence over the
+ -- global $TOTO on Windows
+ nvim('command', "let g:job_opts = {'env': {'Toto': 'def'}, 'stdout_buffered': v:true}")
+ if iswin() then
+ nvim('command', [[let j = jobstart('set | find /I "toto="', g:job_opts)]])
+ else
+ nvim('command', [[let j = jobstart('env | grep -i toto=', g:job_opts)]])
+ end
+ nvim('command', "call jobwait([j])")
+ nvim('command', "let g:output = Normalize(g:job_opts.stdout)")
+ local actual = eval('g:output')
+ local expected
+ if iswin() then
+ -- Toto is normalized to TOTO so we can detect duplicates, and because
+ -- Windows doesn't care about case
+ expected = {'TOTO=def', ''}
+ else
+ expected = {'TOTO=abc', 'Toto=def', ''}
+ end
+ table.sort(actual)
+ table.sort(expected)
+ eq(expected, actual)
+ end)
+
it('uses &shell and &shellcmdflag if passed a string', function()
nvim('command', "let $VAR = 'abc'")
if iswin() then