From 04f2f864e270e772c6326cefdf24947f0130e492 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Jan 2024 02:09:18 +0100 Subject: refactor: format test/* --- test/functional/vimscript/environ_spec.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'test/functional/vimscript/environ_spec.lua') diff --git a/test/functional/vimscript/environ_spec.lua b/test/functional/vimscript/environ_spec.lua index 52218d3cc9..c5821567ff 100644 --- a/test/functional/vimscript/environ_spec.lua +++ b/test/functional/vimscript/environ_spec.lua @@ -11,13 +11,13 @@ local setenv = helpers.funcs.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%'") -- cgit From 795f896a5772d5e0795f86642bdf90c82efac45c Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 12 Jan 2024 17:59:57 +0000 Subject: test: rename (meths, funcs) -> (api, fn) --- test/functional/vimscript/environ_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/functional/vimscript/environ_spec.lua') diff --git a/test/functional/vimscript/environ_spec.lua b/test/functional/vimscript/environ_spec.lua index c5821567ff..0763def84e 100644 --- a/test/functional/vimscript/environ_spec.lua +++ b/test/functional/vimscript/environ_spec.lua @@ -1,13 +1,13 @@ 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() -- cgit