Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 20142:fe8d0a4344df v8.2.0626
patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script
Commit: https://github.com/vim/vim/commit/f93c7fea084a99848d512ff2732041d4b41d93c8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 23 22:16:53 2020 +0200
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Apr 2020 22:30:03 +0200 |
parents | d0a9766167ab |
children | 0612c64a2b87 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -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