From ec273a2c6ba055810539f2d58353c9c0fc8db320 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 8 Apr 2021 18:48:43 -0400 Subject: [PATCH] vim-patch:8.2.0623: typo in test comment Problem: Typo in test comment. (Christ van Willegen) Solution: Avoid mixing up a data structure with a body part. https://github.com/vim/vim/commit/f7b398c6a9476a2004a42555b731ebf47b866408 Cherry-pick Test_dict_lock_operator() from patch v8.2.0619. --- src/nvim/testdir/test_listdict.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim index 8e2a987e74..9b871b5707 100644 --- a/src/nvim/testdir/test_listdict.vim +++ b/src/nvim/testdir/test_listdict.vim @@ -506,6 +506,15 @@ func Test_dict_lock_extend() call assert_equal({'a': 99, 'b': 100}, d) endfunc +" Cannot use += with a locked dict +func Test_dict_lock_operator() + unlet! d + let d = {} + lockvar d + call assert_fails("let d += {'k' : 10}", 'E741:') + unlockvar d +endfunc + " No remove() of write-protected scope-level variable func! Tfunc(this_is_a_long_parameter_name) call assert_fails("call remove(a:, 'this_is_a_long_parameter_name')", 'E742')