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

patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script

Problem:    Vim9: wrong syntax of function in Vim9 script.
Solution:   Give error for missing space. Implement :echomsg and :echoerr.
            (closes #5670)
This commit is contained in:
Bram Moolenaar
2020-04-23 22:16:53 +02:00
parent 1df8b3fb04
commit f93c7fea08
10 changed files with 141 additions and 48 deletions

View File

@@ -54,6 +54,10 @@ def Test_assignment()
let dict4: dict<any> = #{one: 1, two: '2'}
let dict5: dict<blob> = #{one: 0z01, tw: 0z02}
call CheckDefFailure(['let x:string'], 'E1069:')
call CheckDefFailure(['let x:string = "x"'], 'E1069:')
call CheckDefFailure(['let a:string = "x"'], 'E1082:')
let a: number = 6
assert_equal(6, a)
@@ -976,6 +980,20 @@ def Test_echo_cmd()
call CheckDefFailure(['echo "xxx"# comment'], 'E488:')
enddef
def Test_echomsg_cmd()
echomsg 'some' 'more' # comment
assert_match('^some more$', Screenline(&lines))
echo 'clear'
1messages
assert_match('^some more$', Screenline(&lines))
call CheckDefFailure(['echomsg "xxx"# comment'], 'E488:')
enddef
def Test_echoerr_cmd()
# TODO: write this test
enddef
def Test_for_outside_of_function()
let lines =<< trim END
vim9script