forked from aniani/vim
patch 8.2.0321: Vim9: ":execute" does not work yet
Problem: Vim9: ":execute" does not work yet. Solution: Add ISN_EXECUTE. (closes #5699) Also make :echo work with more than one argument.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user