Mercurial > vim
diff src/testdir/test_eval_stuff.vim @ 16366:6ee80f3b5ea9 v8.1.1188
patch 8.1.1188: not all Vim variables require the v: prefix
commit https://github.com/vim/vim/commit/d2e716e6dfd50b605867c7c684373384c8edf707
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 20 14:39:52 2019 +0200
patch 8.1.1188: not all Vim variables require the v: prefix
Problem: Not all Vim variables require the v: prefix.
Solution: When scriptversion is 3 all Vim variables can only be used with
the v: prefix. (Ken Takata, closes #4274)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Apr 2019 14:45:06 +0200 |
parents | abb67309c1ca |
children | 235a2b941498 |
line wrap: on
line diff
--- a/src/testdir/test_eval_stuff.vim +++ b/src/testdir/test_eval_stuff.vim @@ -154,6 +154,22 @@ func Test_string_concat_scriptversion1() endif endfunc +scriptversion 3 +func Test_vvar_scriptversion3() + call assert_fails('echo version', 'E121:') + call assert_false(exists('version')) + let version = 1 + call assert_equal(1, version) +endfunc + +scriptversion 2 +func Test_vvar_scriptversion2() + call assert_true(exists('version')) + echo version + call assert_fails('let version = 1', 'E46:') + call assert_equal(v:version, version) +endfunc + func Test_scriptversion() call writefile(['scriptversion 9'], 'Xversionscript') call assert_fails('source Xversionscript', 'E999:')