summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-26 17:05:00 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-26 17:05:00 +0100
commitcc4423ae13d78367a3d0b5756783523d3b3a1d31 (patch)
tree771301a581eaf21d3dadd8c4d2fb90f7ab540ef4 /src/testdir
parent8f76e6b12b958f2779444a92234bbaf3f49eeb99 (diff)
downloadvim-git-cc4423ae13d78367a3d0b5756783523d3b3a1d31.tar.gz
patch 8.1.2349: :lockvar and :unlockvar cannot be followed by "| endif"v8.1.2349
Problem: :lockvar and :unlockvar cannot be followed by "| endif". Solution: Check for following commands. (closes #5269)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_const.vim14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim
index 8df34f4ad..7f950910b 100644
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -203,6 +203,20 @@ func Test_const_with_condition()
call assert_equal(0, x)
endfunc
+func Test_lockvar()
+ let x = 'hello'
+ lockvar x
+ call assert_fails('let x = "there"', 'E741')
+ if 0 | unlockvar x | endif
+ call assert_fails('let x = "there"', 'E741')
+ unlockvar x
+ let x = 'there'
+
+ if 0 | lockvar x | endif
+ let x = 'again'
+endfunc
+
+
func Test_const_with_index_access()
let l = [1, 2, 3]
call assert_fails('const l[0] = 4', 'E996:')