summaryrefslogtreecommitdiff
path: root/src/testdir
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
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')
-rw-r--r--src/testdir/test_listdict.vim21
-rw-r--r--src/testdir/test_vim9_assign.vim16
2 files changed, 29 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
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index d191ac0bd..e1fe09578 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -2017,6 +2017,22 @@ def Test_unlet()
'defcompile',
], 'E1081:')
+ CheckScriptFailure([
+ 'vim9script',
+ 'def Delcount(dict: dict<any>)',
+ ' unlet dict.count',
+ 'enddef',
+ 'Delcount(v:)',
+ ], 'E742:')
+
+ CheckScriptFailure([
+ 'vim9script',
+ 'def DelChangedtick(dict: dict<any>)',
+ ' unlet dict.changedtick',
+ 'enddef',
+ 'DelChangedtick(b:)',
+ ], 'E795:')
+
writefile(['vim9script', 'export var svar = 1234'], 'XunletExport.vim')
var lines =<< trim END
vim9script