Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 19822:fc3cdc819d80 v8.2.0467
patch 8.2.0467: Vim9: some errors are not tested
Commit: https://github.com/vim/vim/commit/33fa29cf74ea314f89cfa58ec9ffc2d6781a59d4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 28 19:41:33 2020 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 28 Mar 2020 19:45:04 +0100 |
parents | c1c88b333481 |
children | 37c4779ca8f5 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -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)