Files
neovim/test/functional/eval/environ_spec.lua
Justin M. Keyes 278c5d452c win/os_env_exists(): workaround libuv bug #10734
os_env_exists() fails on MSVC build:
    os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN

- Revert 396a3945c4
- HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until
  libuv bug is fixed: https://github.com/libuv/libuv/issues/2413

ref 396a3945c4 (r34642361)
2019-08-10 11:48:36 +02:00

19 lines
572 B
Lua

local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local environ = helpers.funcs.environ
local exists = helpers.funcs.exists
describe('environment variables', function()
it('environ() handles empty env variable', function()
clear({env={EMPTY_VAR=""}})
eq("", environ()['EMPTY_VAR'])
eq(nil, environ()['DOES_NOT_EXIST'])
end)
it('exists() handles empty env variable', function()
clear({env={EMPTY_VAR=""}})
eq(1, exists('$EMPTY_VAR'))
eq(0, exists('$DOES_NOT_EXIST'))
end)
end)