0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.0602: :unlet $VAR does not work properly

Problem:    :unlet $VAR does not work properly.
Solution:   Make ":lockvar $VAR" fail.  Check the "skip" flag.
This commit is contained in:
Bram Moolenaar
2020-04-19 17:24:53 +02:00
parent d72c1bf0a6
commit 7e0868efcf
4 changed files with 52 additions and 20 deletions

View File

@@ -1711,6 +1711,20 @@ func Test_compound_assignment_operators()
let @/ = ''
endfunc
func Test_unlet_env()
let $TESTVAR = 'yes'
call assert_equal('yes', $TESTVAR)
call assert_fails('lockvar $TESTVAR', 'E940')
call assert_fails('unlockvar $TESTVAR', 'E940')
call assert_equal('yes', $TESTVAR)
if 0
unlet $TESTVAR
endif
call assert_equal('yes', $TESTVAR)
unlet $TESTVAR
call assert_equal('', $TESTVAR)
endfunc
func Test_refcount()
" Immediate values
call assert_equal(-1, test_refcount(1))