diff options
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_const.vim | 14 |
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:') |