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

patch 8.2.0477: Vim9: error messages not tested

Problem:    Vim9: error messages not tested.
Solution:   Add more tests.
This commit is contained in:
Bram Moolenaar
2020-03-29 18:40:30 +02:00
parent 52ea92b19d
commit c58164c5cf
3 changed files with 29 additions and 1 deletions

View File

@@ -728,6 +728,13 @@ def Test_expr7_dict()
let val = 1
assert_equal(g:dict_one, {key: val})
call CheckDefFailure("let x = #{8: 8}", 'E1014:')
call CheckDefFailure("let x = #{xxx}", 'E720:')
call CheckDefFailure("let x = #{xxx: 1", 'E722:')
call CheckDefFailure("let x = #{xxx: 1,", 'E723:')
call CheckDefFailure("let x = {'a': xxx}", 'E1001:')
call CheckDefFailure("let x = {xxx: 8}", 'E1001:')
call CheckDefFailure("let x = #{a: 1, a: 2}", 'E721:')
call CheckDefExecFailure("let x = g:anint.member", 'E715:')
call CheckDefExecFailure("let x = g:dict_empty.member", 'E716:')
enddef
@@ -750,6 +757,8 @@ def Test_expr7_environment()
" environment variable
assert_equal('testvar', $TESTVAR)
assert_equal('', $ASDF_ASD_XXX)
call CheckDefFailure("let x = $$$", 'E1002:')
enddef
def Test_expr7_register()
@@ -802,6 +811,9 @@ func Test_expr7_fails()
call CheckDefFailure("let x = -'xx'", "E1030:")
call CheckDefFailure("let x = +'xx'", "E1030:")
call CheckDefFailure("let x = -0z12", "E974:")
call CheckDefExecFailure("let x = -[8]", "E39:")
call CheckDefExecFailure("let x = -{'a': 1}", "E39:")
call CheckDefFailure("let x = @", "E1002:")
call CheckDefFailure("let x = @<", "E354:")