{"getcwd", 0, 2, FEARG_1, NULL,
ret_string, f_getcwd},
{"getenv", 1, 1, FEARG_1, NULL,
- ret_string, f_getenv},
+ ret_any, f_getenv},
{"getfontname", 0, 1, 0, NULL,
ret_string, f_getfontname},
{"getfperm", 1, 1, FEARG_1, NULL,
getchar(true)->assert_equal(0)
enddef
+def Test_getenv()
+ if getenv('does-not_exist') == ''
+ assert_report('getenv() should return null')
+ endif
+ if getenv('does-not_exist') == null
+ else
+ assert_report('getenv() should return null')
+ endif
+ $SOMEENVVAR = 'some'
+ assert_equal('some', getenv('SOMEENVVAR'))
+ unlet $SOMEENVVAR
+enddef
+
def Test_getcompletion()
set wildignore=*.vim,*~
var l = getcompletion('run', 'file', true)