diff src/testdir/test_listdict.vim @ 26624:bdf11d8e3df3 v8.2.3841

patch 8.2.3841: Vim9: outdated TODO items, disabled tests that work Commit: https://github.com/vim/vim/commit/71b768509250b12696e8cc90e5902029f1b5433d Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 17 20:15:38 2021 +0000 patch 8.2.3841: Vim9: outdated TODO items, disabled tests that work 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.
author Bram Moolenaar <Bram@vim.org>
date Fri, 17 Dec 2021 21:30:03 +0100
parents 936f77929f16
children 4d18b3a5254a
line wrap: on
line diff
--- 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