summaryrefslogtreecommitdiff
path: root/src/testdir/test_listdict.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-17 20:15:38 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-17 20:15:38 +0000
commit71b768509250b12696e8cc90e5902029f1b5433d (patch)
treecedd129c1f525760d90fde63fa163642f590a1a0 /src/testdir/test_listdict.vim
parentddc80aff575dd60c04c79621a0358cf0abaac53a (diff)
downloadvim-git-71b768509250b12696e8cc90e5902029f1b5433d.tar.gz
patch 8.2.3841: Vim9: outdated TODO items, disabled tests that workv8.2.3841
Problem: Vim9: outdated TODO items, disabled tests that work. Solution: Remove TODO items, run tests that work now. Check that a dict item isn't locked.
Diffstat (limited to 'src/testdir/test_listdict.vim')
-rw-r--r--src/testdir/test_listdict.vim21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim
index 10cb78662..957520bcc 100644
--- a/src/testdir/test_listdict.vim
+++ b/src/testdir/test_listdict.vim
@@ -743,10 +743,7 @@ func Test_dict_item_lock_unlet()
unlet d.a
call assert_equal({'b': 100}, d)
END
- " TODO: make this work in a :def function
- "call CheckLegacyAndVim9Success(lines)
- call CheckTransLegacySuccess(lines)
- call CheckTransVim9Success(lines)
+ call CheckLegacyAndVim9Success(lines)
endfunc
" filter() after lock on dict item
@@ -757,10 +754,7 @@ func Test_dict_lock_filter()
call filter(d, 'v:key != "a"')
call assert_equal({'b': 100}, d)
END
- " TODO: make this work in a :def function
- "call CheckLegacyAndVim9Success(lines)
- call CheckTransLegacySuccess(lines)
- call CheckTransVim9Success(lines)
+ call CheckLegacyAndVim9Success(lines)
endfunc
" map() after lock on dict
@@ -774,6 +768,17 @@ func Test_dict_lock_map()
" This won't work in a :def function
call CheckTransLegacySuccess(lines)
call CheckTransVim9Success(lines)
+
+ " For a :def function use a global dict.
+ let lines =<< trim END
+ let g:thedict = {'a': 77, 'b': 88}
+ lockvar 1 g:thedict
+ def Delkey()
+ unlet g:thedict.a
+ enddef
+ call Delkey()
+ END
+ call CheckScriptFailure(lines, 'E741:')
endfunc
" No extend() after lock on dict item