Mercurial > vim
view src/testdir/test_execute_func.vim @ 14921:b2308693cb87 v8.1.0472
patch 8.1.0472: dosinst command has a few flaws
commit https://github.com/vim/vim/commit/6cdb2c9811c33dbd312a5a2b711ee83f512ae7b2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 13 17:25:27 2018 +0200
patch 8.1.0472: dosinst command has a few flaws
Problem: Dosinst command has a few flaws.
Solution: Register DisplayIcon, DisplayVersion and Publisher for the
uninstaller. (closes #3485) Don't set 'diffexpr' if internal diff
is supported. Allow for using Vi compatible from the command line.
Remove needless sleeps. Add comments in the generated _vimrc.
(Ken Takata, closes #3525)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 13 Oct 2018 17:30:05 +0200 |
parents | 9da0cb39cbee |
children | 2fed75dee954 |
line wrap: on
line source
" test execute() func NestedEval() let nested = execute('echo "nested\nlines"') echo 'got: "' . nested . '"' endfunc func NestedRedir() redir => var echo 'broken' redir END endfunc func Test_execute_string() call assert_equal("\nnocompatible", execute('set compatible?')) call assert_equal("\nsomething\nnice", execute('echo "something\nnice"')) call assert_equal("noendofline", execute('echon "noendofline"')) call assert_equal("", execute(123)) call assert_equal("\ngot: \"\nnested\nlines\"", execute('call NestedEval()')) redir => redired echo 'this' let evaled = execute('echo "that"') echo 'theend' redir END call assert_equal("\nthis\ntheend", redired) call assert_equal("\nthat", evaled) call assert_fails('call execute("doesnotexist")', 'E492:') call assert_fails('call execute(3.4)', 'E806:') call assert_fails('call execute("call NestedRedir()")', 'E930:') call assert_equal("\nsomething", execute('echo "something"', '')) call assert_equal("\nsomething", execute('echo "something"', 'silent')) call assert_equal("\nsomething", execute('echo "something"', 'silent!')) call assert_equal("", execute('burp', 'silent!')) call assert_fails('call execute("echo \"x\"", 3.4)', 'E806:') call assert_equal("", execute(test_null_string())) endfunc func Test_execute_list() call assert_equal("\nsomething\nnice", execute(['echo "something"', 'echo "nice"'])) let l = ['for n in range(0, 3)', \ 'echo n', \ 'endfor'] call assert_equal("\n0\n1\n2\n3", execute(l)) call assert_equal("", execute([])) call assert_equal("", execute(test_null_list())) endfunc