0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.3281: Vim9: TODO items in tests can be taken care of

Problem:    Vim9: TODO items in tests can be taken care of.
Solution:   Update test for now working functionality. (closes #8694)
This commit is contained in:
Bram Moolenaar
2021-08-03 21:16:18 +02:00
parent 51ad850f5f
commit 23e2e11515
4 changed files with 8 additions and 21 deletions

View File

@@ -1228,23 +1228,11 @@ def Test_assign_dict()
d.somekey = 'someval'
assert_equal({key: 'value', '123': 'qwerty', somekey: 'someval'}, d)
# unlet d.somekey
# assert_equal({key: 'value', '123': 'qwerty'}, d)
unlet d.somekey
assert_equal({key: 'value', '123': 'qwerty'}, d)
END
CheckDefAndScriptSuccess(lines)
# TODO: move to above once "unlet d.somekey" in :def is implemented
lines =<< trim END
vim9script
var d: dict<string> = {}
d['key'] = 'value'
d.somekey = 'someval'
assert_equal({key: 'value', somekey: 'someval'}, d)
unlet d.somekey
assert_equal({key: 'value'}, d)
END
CheckScriptSuccess(lines)
CheckDefFailure(["var d: dict<number> = {a: '', b: true}"], 'E1012: Type mismatch; expected dict<number> but got dict<any>', 1)
CheckDefFailure(["var d: dict<dict<number>> = {x: {a: '', b: true}}"], 'E1012: Type mismatch; expected dict<dict<number>> but got dict<dict<any>>', 1)
enddef