Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
30216:cafa3e83fdde | 30217:e0cb5fb44859 |
---|---|
1934 | 1934 |
1935 def Test_var_not_cmd() | 1935 def Test_var_not_cmd() |
1936 var lines =<< trim END | 1936 var lines =<< trim END |
1937 g:notexist:cmd | 1937 g:notexist:cmd |
1938 END | 1938 END |
1939 v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :cmd', 'E121: Undefined variable: g:notexist'], 1) | 1939 v9.CheckDefAndScriptFailure(lines, ['E1016: Cannot declare a global variable: g:notexist', "E1069: White space required after ':'"], 1) |
1940 | 1940 |
1941 lines =<< trim END | 1941 lines =<< trim END |
1942 g-pat-cmd | 1942 g-pat-cmd |
1943 END | 1943 END |
1944 v9.CheckDefAndScriptFailure(lines, 'E1241:', 1) | 1944 v9.CheckDefAndScriptFailure(lines, 'E1241:', 1) |
1948 v9.CheckDefAndScriptFailure(lines, ['E1001: Variable not found: g', 'E121: Undefined variable: g'], 1) | 1948 v9.CheckDefAndScriptFailure(lines, ['E1001: Variable not found: g', 'E121: Undefined variable: g'], 1) |
1949 | 1949 |
1950 lines =<< trim END | 1950 lines =<< trim END |
1951 s:notexist:repl | 1951 s:notexist:repl |
1952 END | 1952 END |
1953 v9.CheckDefAndScriptFailure(lines, ['E488: Trailing characters: :repl', 'E1268:'], 1) | 1953 v9.CheckDefAndScriptFailure(lines, ['E1101: Cannot declare a script variable in a function: s:notexist', "E1069: White space required after ':'"], 1) |
1954 | 1954 |
1955 lines =<< trim END | 1955 lines =<< trim END |
1956 notexist:repl | 1956 notexist:repl |
1957 END | 1957 END |
1958 v9.CheckDefAndScriptFailure(lines, ['E476:', 'E492:'], 1) | 1958 v9.CheckDefAndScriptFailure(lines, ['E476:', 'E492:'], 1) |