aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_vimscript.vim
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2020-12-02 13:44:13 +0000
committerGitHub <noreply@github.com>2020-12-02 08:44:13 -0500
commit8fb786e415d1c3538452885455b2268d13f640a6 (patch)
tree3b9171dda85efadb38324f6a88c4ffcce69415f5 /src/nvim/testdir/test_vimscript.vim
parentd80f262f894bfc1d8a8ba79fdc5d1c14f738a140 (diff)
downloadrneovim-8fb786e415d1c3538452885455b2268d13f640a6.tar.gz
rneovim-8fb786e415d1c3538452885455b2268d13f640a6.tar.bz2
rneovim-8fb786e415d1c3538452885455b2268d13f640a6.zip
vim-patch:8.2.0602: :unlet $VAR does not work properly (#13238)
Problem: :unlet $VAR does not work properly. Solution: Make ":lockvar $VAR" fail. Check the "skip" flag. https://github.com/vim/vim/commit/7e0868efcf094f2cc59fa4e18af3a8dc7aedd64f Include patch 8.2.0601 changes so that ex_unletlock() can execute a callback if there are no errors.
Diffstat (limited to 'src/nvim/testdir/test_vimscript.vim')
-rw-r--r--src/nvim/testdir/test_vimscript.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim
index 072c3d28e7..4edf8308e7 100644
--- a/src/nvim/testdir/test_vimscript.vim
+++ b/src/nvim/testdir/test_vimscript.vim
@@ -1393,6 +1393,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_funccall_garbage_collect()
func Func(x, ...)
call add(a:x, a:000)