diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-03-10 16:08:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-03-10 16:08:26 +0100 |
commit | 7ad67d1150a1e48371d64e2919591c38b80e7cfc (patch) | |
tree | f92b2c58722bb67749c0154a83eb1167af5a623a /src/testdir/test_vim9_builtin.vim | |
parent | ffb7dcdb773c250a6acf45d5670a508be9248cb6 (diff) |
patch 8.2.2583: Vim9: cannot compare result of getenv() with nullv8.2.2583
Problem: Vim9: cannot compare result of getenv() with null.
Solution: Make the return type of getenv() "any". (closes #7943)
Diffstat (limited to 'src/testdir/test_vim9_builtin.vim')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 3ee8a620f6..8ec3db1482 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -472,6 +472,19 @@ def Test_getchar() 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) |