Mercurial > vim
diff src/testdir/test_vim9_cmd.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 | 58fb880f3607 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -1936,7 +1936,7 @@ def Test_var_not_cmd() var lines =<< trim END g:notexist:cmd END - v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist'], 1) + v9.CheckDefAndScriptFailure(lines, ['E1016: Cannot declare a global variable: g:notexist', "E1069: White space required after ':'"], 1) lines =<< trim END g-pat-cmd @@ -1950,7 +1950,7 @@ def Test_var_not_cmd() lines =<< trim END s:notexist:repl END - v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :repl', 'E1268:'], 1) + v9.CheckDefAndScriptFailure(lines, ['E1101: Cannot declare a script variable in a function: s:notexist', "E1069: White space required after ':'"], 1) lines =<< trim END notexist:repl