0
0
mirror of https://github.com/vim/vim.git synced 2025-09-30 04:44:14 -04:00

patch 8.2.0467: Vim9: some errors are not tested

Problem:    Vim9: some errors are not tested
Solution:   Add more tests.  Fix that Vim9 script flag is not reset.
This commit is contained in:
Bram Moolenaar
2020-03-28 19:41:33 +01:00
parent 09c569038c
commit 33fa29cf74
6 changed files with 61 additions and 7 deletions

View File

@@ -101,6 +101,8 @@ func Test_assignment_failure()
call CheckDefFailure(['let true = 1'], 'E1034:')
call CheckDefFailure(['let false = 1'], 'E1034:')
call CheckScriptFailure(['vim9script', 'def Func()', 'let dummy = s:notfound', 'enddef'], 'E1050:')
call CheckDefFailure(['let var: list<string> = [123]'], 'expected list<string> but got list<number>')
call CheckDefFailure(['let var: list<number> = ["xx"]'], 'expected list<number> but got list<string>')
@@ -618,6 +620,12 @@ def Test_vim9script_call()
enddef
{'a': 1, 'b': 2}->DictFunc()
assert_equal(#{a: 1, b: 2}, dictvar)
def CompiledDict()
{'a': 3, 'b': 4}->DictFunc()
enddef
CompiledDict()
assert_equal(#{a: 3, b: 4}, dictvar)
#{a: 3, b: 4}->DictFunc()
assert_equal(#{a: 3, b: 4}, dictvar)