diff options
author | rhysd <lin90162@yahoo.co.jp> | 2019-06-23 21:04:51 +0900 |
---|---|---|
committer | rhysd <lin90162@yahoo.co.jp> | 2019-06-24 09:31:30 +0900 |
commit | 3d5a800278aacce3cf332e2e416975905881b8f6 (patch) | |
tree | a09e8d5d280bff12f1e363bba8d5bd442ac3c9fd /src | |
parent | bd0615590b901b99e8cce3c5e52c83af69649cd5 (diff) | |
download | rneovim-3d5a800278aacce3cf332e2e416975905881b8f6.tar.gz rneovim-3d5a800278aacce3cf332e2e416975905881b8f6.tar.bz2 rneovim-3d5a800278aacce3cf332e2e416975905881b8f6.zip |
vim-patch:8.1.1554: docs and tests for :const can be improved
Problem: Docs and tests for :const can be improved.
Solution: Improve documentation, add a few more tests. (Ryuichi Hayashida,
closes vim/vim#4551)
https://github.com/vim/vim/commit/1c196e7b1742c1a50ce0d74190721acaad087f81
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_const.vim | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_const.vim b/src/nvim/testdir/test_const.vim index 641f7cc051..06062c5e58 100644 --- a/src/nvim/testdir/test_const.vim +++ b/src/nvim/testdir/test_const.vim @@ -18,6 +18,19 @@ func Test_define_var_with_lock() const b = v:true const n = v:null + call assert_true(exists('i')) + call assert_true(exists('f')) + call assert_true(exists('s')) + call assert_true(exists('F')) + call assert_true(exists('l')) + call assert_true(exists('d')) + if has('channel') + call assert_true(exists('j')) + call assert_true(exists('c')) + endif + call assert_true(exists('b')) + call assert_true(exists('n')) + call assert_fails('let i = 1', 'E741:') call assert_fails('let f = 1.1', 'E741:') call assert_fails('let s = "vim"', 'E741:') @@ -199,6 +212,17 @@ func Test_const_with_special_variables() call assert_fails('const &g:encoding = "utf-8"', 'E996:') endfunc +func Test_const_with_eval_name() + let s = 'foo' + + " eval name with :const should work + const abc_{s} = 1 + const {s}{s} = 1 + + let s2 = 'abc_foo' + call assert_fails('const {s2} = "bar"', 'E995:') +endfunc + func Test_lock_depth_is_1() const l = [1, 2, 3] const d = {'foo': 10} |