comparison src/testdir/test_vim9_script.vim @ 30217:e0cb5fb44859 v9.0.0444

patch 9.0.0444: trying to declare g:variable gives confusing error Commit: https://github.com/vim/vim/commit/9510d22463055f56548ff461ccbc54caa1ba1a2f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Sep 11 15:14:05 2022 +0100 patch 9.0.0444: trying to declare g:variable gives confusing error Problem: Trying to declare g:variable gives confusing error. Solution: Give a better error message. (closes https://github.com/vim/vim/issues/11108)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Sep 2022 16:15:04 +0200
parents 13b02c1ea0f7
children 327bca7b70ea
comparison
equal deleted inserted replaced
30216:cafa3e83fdde 30217:e0cb5fb44859
4239 CheckRunVimInTerminal 4239 CheckRunVimInTerminal
4240 call Run_Test_misplaced_type() 4240 call Run_Test_misplaced_type()
4241 endfunc 4241 endfunc
4242 4242
4243 def Run_Test_misplaced_type() 4243 def Run_Test_misplaced_type()
4244 writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type') 4244 writefile(['let g:somevar = "asdf"'], 'XTest_misplaced_type', 'D')
4245 var buf = g:RunVimInTerminal('-S XTest_misplaced_type', {'rows': 6}) 4245 var buf = g:RunVimInTerminal('-S XTest_misplaced_type', {'rows': 6})
4246 term_sendkeys(buf, ":vim9cmd echo islocked('g:somevar: string')\<CR>") 4246 term_sendkeys(buf, ":vim9cmd echo islocked('somevar: string')\<CR>")
4247 g:VerifyScreenDump(buf, 'Test_misplaced_type', {}) 4247 g:VerifyScreenDump(buf, 'Test_misplaced_type', {})
4248 4248
4249 g:StopVimInTerminal(buf) 4249 g:StopVimInTerminal(buf)
4250 delete('XTest_misplaced_type')
4251 enddef 4250 enddef
4252 4251
4253 " Ensure echo doesn't crash when stringifying empty variables. 4252 " Ensure echo doesn't crash when stringifying empty variables.
4254 def Test_echo_uninit_variables() 4253 def Test_echo_uninit_variables()
4255 var res: string 4254 var res: string