comparison 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
comparison
equal deleted inserted replaced
19527:b4e703999a84 19528:3b026343f398
1 " Test various aspects of the Vim9 script language. 1 " Test various aspects of the Vim9 script language.
2 2
3 source check.vim 3 source check.vim
4 source view_util.vim
4 5
5 " Check that "lines" inside ":def" results in an "error" message. 6 " Check that "lines" inside ":def" results in an "error" message.
6 func CheckDefFailure(lines, error) 7 func CheckDefFailure(lines, error)
7 call writefile(['def Func()'] + a:lines + ['enddef'], 'Xdef') 8 call writefile(['def Func()'] + a:lines + ['enddef'], 'Xdef')
8 call assert_fails('so Xdef', a:error, a:lines) 9 call assert_fails('so Xdef', a:error, a:lines)
690 source Xvim9lines 691 source Xvim9lines
691 692
692 delete('Xvim9lines') 693 delete('Xvim9lines')
693 enddef 694 enddef
694 695
696 def Test_execute_cmd()
697 new
698 setline(1, 'default')
699 execute 'call setline(1, "execute-string")'
700 assert_equal('execute-string', getline(1))
701 let cmd1 = 'call setline(1,'
702 let cmd2 = '"execute-var")'
703 execute cmd1 cmd2
704 assert_equal('execute-var', getline(1))
705 execute cmd1 cmd2 '|call setline(1, "execute-var-string")'
706 assert_equal('execute-var-string', getline(1))
707 let cmd_first = 'call '
708 let cmd_last = 'setline(1, "execute-var-var")'
709 execute cmd_first .. cmd_last
710 assert_equal('execute-var-var', getline(1))
711 bwipe!
712 enddef
713
714 def Test_echo_cmd()
715 echo 'something'
716 assert_match('^something$', Screenline(&lines))
717
718 let str1 = 'some'
719 let str2 = 'more'
720 echo str1 str2
721 assert_match('^some more$', Screenline(&lines))
722 enddef
723
695 724
696 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker 725 " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker