mirror of
https://github.com/neovim/neovim.git
synced 2025-11-13 13:59:16 +00:00
refactor: format test/*
This commit is contained in:
@@ -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%'")
|
||||
|
||||
Reference in New Issue
Block a user