summaryrefslogtreecommitdiff
path: root/src/testdir/test_const.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-26 16:50:30 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-26 16:50:30 +0100
commit8f76e6b12b958f2779444a92234bbaf3f49eeb99 (patch)
tree36c6d1bb7f575255ca0743dccde1523436134a43 /src/testdir/test_const.vim
parent84f903326d44db9b75fc3a39d4866f636f9ad4cd (diff)
downloadvim-git-8f76e6b12b958f2779444a92234bbaf3f49eeb99.tar.gz
patch 8.1.2348: :const cannot be followed by "| endif"v8.1.2348
Problem: :const cannot be followed by "| endif". Solution: Check following command for :const. (closes #5269) Also fix completion after :const.
Diffstat (limited to 'src/testdir/test_const.vim')
-rw-r--r--src/testdir/test_const.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim
index 55e4492bd..8df34f4ad 100644
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -197,6 +197,12 @@ func Test_cannot_modify_existing_variable()
call assert_fails('const [i2, f2, s2] = [1, 1.1, "vim"]', 'E995:')
endfunc
+func Test_const_with_condition()
+ const x = 0
+ if 0 | const x = 1 | endif
+ call assert_equal(0, x)
+endfunc
+
func Test_const_with_index_access()
let l = [1, 2, 3]
call assert_fails('const l[0] = 4', 'E996:')