Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 21098:e88b0daa2fcb v8.2.1100
patch 8.2.1100: Vim9: cannot use line break in :execute argument
Commit: https://github.com/vim/vim/commit/47e880d6c13c3ec2888398fd9ba1f5a7180d791a
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jun 30 22:02:02 2020 +0200
patch 8.2.1100: Vim9: cannot use line break in :execute argument
Problem: Vim9: cannot use line break in :execute, :echomsg and :echoerr
argument.
Solution: Check for line break.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 30 Jun 2020 22:15:04 +0200 |
parents | 74e5e212e550 |
children | 839ace6773aa |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1294,6 +1294,19 @@ def Test_execute_cmd() call CheckDefFailure(['execute "cmd"# comment'], 'E488:') enddef +def Test_execute_cmd_vimscript() + " only checks line continuation + let lines =<< trim END + vim9script + execute 'g:someVar' + .. ' = ' .. + '28' + assert_equal(28, g:someVar) + unlet g:someVar + END + CheckScriptSuccess(lines) +enddef + def Test_echo_cmd() echo 'some' # comment echon 'thing' @@ -1321,6 +1334,18 @@ def Test_echomsg_cmd() call CheckDefFailure(['echomsg "xxx"# comment'], 'E488:') enddef +def Test_echomsg_cmd_vimscript() + " only checks line continuation + let lines =<< trim END + vim9script + echomsg 'here' + .. ' is ' .. + 'a message' + assert_match('^here is a message$', Screenline(&lines)) + END + CheckScriptSuccess(lines) +enddef + def Test_echoerr_cmd() try echoerr 'something' 'wrong' # comment @@ -1329,6 +1354,21 @@ def Test_echoerr_cmd() endtry enddef +def Test_echoerr_cmd_vimscript() + " only checks line continuation + let lines =<< trim END + vim9script + try + echoerr 'this' + .. ' is ' .. + 'wrong' + catch + assert_match('this is wrong', v:exception) + endtry + END + CheckScriptSuccess(lines) +enddef + def Test_for_outside_of_function() let lines =<< trim END vim9script