Mercurial > vim
diff src/testdir/test_vim9_script.vim @ 19528:3b026343f398 v8.2.0321
patch 8.2.0321: Vim9: ":execute" does not work yet
Commit: https://github.com/vim/vim/commit/ad39c094d261109a695aba2c4f19fe336736cc55
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 26 18:23:43 2020 +0100
patch 8.2.0321: Vim9: ":execute" does not work yet
Problem: Vim9: ":execute" does not work yet.
Solution: Add ISN_EXECUTE. (closes https://github.com/vim/vim/issues/5699) Also make :echo work with more
than one argument.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 26 Feb 2020 18:30:04 +0100 |
parents | 860b39ed0e0b |
children | 48e71f948360 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim +++ b/src/testdir/test_vim9_script.vim @@ -1,6 +1,7 @@ " Test various aspects of the Vim9 script language. source check.vim +source view_util.vim " Check that "lines" inside ":def" results in an "error" message. func CheckDefFailure(lines, error) @@ -692,5 +693,33 @@ def Test_substitute_cmd() delete('Xvim9lines') enddef +def Test_execute_cmd() + new + setline(1, 'default') + execute 'call setline(1, "execute-string")' + assert_equal('execute-string', getline(1)) + let cmd1 = 'call setline(1,' + let cmd2 = '"execute-var")' + execute cmd1 cmd2 + assert_equal('execute-var', getline(1)) + execute cmd1 cmd2 '|call setline(1, "execute-var-string")' + assert_equal('execute-var-string', getline(1)) + let cmd_first = 'call ' + let cmd_last = 'setline(1, "execute-var-var")' + execute cmd_first .. cmd_last + assert_equal('execute-var-var', getline(1)) + bwipe! +enddef + +def Test_echo_cmd() + echo 'something' + assert_match('^something$', Screenline(&lines)) + + let str1 = 'some' + let str2 = 'more' + echo str1 str2 + assert_match('^some more$', Screenline(&lines)) +enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker