aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/environ_spec.lua
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-07-30 11:55:55 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-06 01:23:11 +0200
commitd55b12ea508500760796ede2bca9b48f391afb80 (patch)
tree3547cf74151f62d98809036f69be0610107a301e /test/functional/eval/environ_spec.lua
parentfd66ad226221a22f223dcfca337e893d0a9cca46 (diff)
downloadrneovim-d55b12ea508500760796ede2bca9b48f391afb80.tar.gz
rneovim-d55b12ea508500760796ede2bca9b48f391afb80.tar.bz2
rneovim-d55b12ea508500760796ede2bca9b48f391afb80.zip
f_environ: cleanup/refactor
- use os_getenvname_at_index / os_getenv - f_getenv: empty (*p == NUL) is not null (undefined)
Diffstat (limited to 'test/functional/eval/environ_spec.lua')
-rw-r--r--test/functional/eval/environ_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/eval/environ_spec.lua b/test/functional/eval/environ_spec.lua
new file mode 100644
index 0000000000..eb52f9e2da
--- /dev/null
+++ b/test/functional/eval/environ_spec.lua
@@ -0,0 +1,12 @@
+local helpers = require('test.functional.helpers')(after_each)
+local clear = helpers.clear
+local eq = helpers.eq
+local environ = helpers.funcs.environ
+
+describe('environ()', function()
+ it('handles empty env variable', function()
+ clear({env={EMPTY_VAR=""}})
+ eq("", environ()['EMPTY_VAR'])
+ eq(nil, environ()['DOES_NOT_EXIST'])
+ end)
+end)