comparison src/testdir/test_vim9_disassemble.vim @ 20099:058b41f85bcb v8.2.0605

patch 8.2.0605: Vim9: cannot unlet an environment variable Commit: https://github.com/vim/vim/commit/7bdaea6e0df849cf3dd7eaaf454eb88f637d1884 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 19 18:27:26 2020 +0200 patch 8.2.0605: Vim9: cannot unlet an environment variable Problem: Vim9: cannot unlet an environment variable. Solution: Implement unlet for $VAR.
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Apr 2020 18:30:04 +0200
parents a64c16ff98b8
children fe8d0a4344df
comparison
equal deleted inserted replaced
20098:a901238a18a2 20099:058b41f85bcb
128 128
129 def s:ScriptFuncUnlet() 129 def s:ScriptFuncUnlet()
130 g:somevar = "value" 130 g:somevar = "value"
131 unlet g:somevar 131 unlet g:somevar
132 unlet! g:somevar 132 unlet! g:somevar
133 unlet $SOMEVAR
133 enddef 134 enddef
134 135
135 def Test_disassemble_unlet() 136 def Test_disassemble_unlet()
136 let res = execute('disass s:ScriptFuncUnlet') 137 let res = execute('disass s:ScriptFuncUnlet')
137 assert_match('<SNR>\d*_ScriptFuncUnlet.*' .. 138 assert_match('<SNR>\d*_ScriptFuncUnlet.*' ..
139 '\d PUSHS "value".*' .. 140 '\d PUSHS "value".*' ..
140 '\d STOREG g:somevar.*' .. 141 '\d STOREG g:somevar.*' ..
141 'unlet g:somevar.*' .. 142 'unlet g:somevar.*' ..
142 '\d UNLET g:somevar.*' .. 143 '\d UNLET g:somevar.*' ..
143 'unlet! g:somevar.*' .. 144 'unlet! g:somevar.*' ..
144 '\d UNLET! g:somevar.*', 145 '\d UNLET! g:somevar.*' ..
146 'unlet $SOMEVAR.*' ..
147 '\d UNLETENV $SOMEVAR.*',
145 res) 148 res)
146 enddef 149 enddef
147 150
148 def s:ScriptFuncTry() 151 def s:ScriptFuncTry()
149 try 152 try