diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-16 20:28:52 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-16 20:28:52 +0100 |
commit | 11a481f711ee2d58c1157e9917779ea424ba3a45 (patch) | |
tree | 69e0ee5348f621a1dc62e40c853ab3764f812505 /test/functional/lua/overrides_spec.lua | |
parent | 8d00393d0cc89511867861dc8ac5cc7b068f9f69 (diff) | |
parent | c9264e6d524b3c2ac1a1388d5627f9b0c717cbc7 (diff) | |
download | rneovim-11a481f711ee2d58c1157e9917779ea424ba3a45.tar.gz rneovim-11a481f711ee2d58c1157e9917779ea424ba3a45.tar.bz2 rneovim-11a481f711ee2d58c1157e9917779ea424ba3a45.zip |
Merge #9686 'win/Lua: monkey-patch os.getenv()'
fixes #9681
Diffstat (limited to 'test/functional/lua/overrides_spec.lua')
-rw-r--r-- | test/functional/lua/overrides_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/lua/overrides_spec.lua b/test/functional/lua/overrides_spec.lua index 007d40874f..8f318e3503 100644 --- a/test/functional/lua/overrides_spec.lua +++ b/test/functional/lua/overrides_spec.lua @@ -300,3 +300,19 @@ describe('package.path/package.cpath', function() eq(new_paths_str, eval_lua('package.path'):sub(1, #new_paths_str)) end) end) + +describe('os.getenv', function() + it('returns nothing for undefined env var', function() + eq(NIL, funcs.luaeval('os.getenv("XTEST_1")')) + end) + it('returns env var set by the parent process', function() + local value = 'foo' + clear({env = {['XTEST_1']=value}}) + eq(value, funcs.luaeval('os.getenv("XTEST_1")')) + end) + it('returns env var set by let', function() + local value = 'foo' + meths.command('let $XTEST_1 = "'..value..'"') + eq(value, funcs.luaeval('os.getenv("XTEST_1")')) + end) +end) |