diff options
Diffstat (limited to 'test/functional/vimscript/environ_spec.lua')
-rw-r--r-- | test/functional/vimscript/environ_spec.lua | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/test/functional/vimscript/environ_spec.lua b/test/functional/vimscript/environ_spec.lua index 52218d3cc9..0763def84e 100644 --- a/test/functional/vimscript/environ_spec.lua +++ b/test/functional/vimscript/environ_spec.lua @@ -1,23 +1,23 @@ 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 -local system = helpers.funcs.system +local environ = helpers.fn.environ +local exists = helpers.fn.exists +local system = helpers.fn.system local nvim_prog = helpers.nvim_prog local command = helpers.command local eval = helpers.eval -local setenv = helpers.funcs.setenv +local setenv = helpers.fn.setenv describe('environment variables', function() it('environ() handles empty env variable', function() - clear({env={EMPTY_VAR=""}}) - eq("", environ()['EMPTY_VAR']) + 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=""}}) + clear({ env = { EMPTY_VAR = '' } }) eq(1, exists('$EMPTY_VAR')) eq(0, exists('$DOES_NOT_EXIST')) end) @@ -46,23 +46,32 @@ describe('empty $HOME', function() end local function write_and_test_tilde() - system({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', - '-c', 'write test_empty_home', '+q'}) + system({ + nvim_prog, + '-u', + 'NONE', + '-i', + 'NONE', + '--headless', + '-c', + 'write test_empty_home', + '+q', + }) eq(false, tilde_in_cwd()) end it("'~' folder not created in cwd if $HOME and related env not defined", function() - command("unlet $HOME") + command('unlet $HOME') write_and_test_tilde() command("let $HOMEDRIVE='C:'") command("let $USERPROFILE='C:\\'") write_and_test_tilde() - command("unlet $HOMEDRIVE") + command('unlet $HOMEDRIVE') write_and_test_tilde() - command("unlet $USERPROFILE") + command('unlet $USERPROFILE') write_and_test_tilde() command("let $HOME='%USERPROFILE%'") |