diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-10-26 21:53:11 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-10-26 22:16:58 +0800 |
| commit | 157baef02636fed4a99ef401e470fee8c51ce852 (patch) | |
| tree | 87a44eb280fa81477ef81a767b14d16f9925af26 /src/nvim/testdir/test_startup.vim | |
| parent | c00e711d5a860fb019f594d164b4327d942313f8 (diff) | |
| download | rneovim-157baef02636fed4a99ef401e470fee8c51ce852.tar.gz rneovim-157baef02636fed4a99ef401e470fee8c51ce852.tar.bz2 rneovim-157baef02636fed4a99ef401e470fee8c51ce852.zip | |
vim-patch:8.1.1826: tests use hand coded feature and option checks
Problem: Tests use hand coded feature and option checks.
Solution: Use the commands from check.vim in more tests.
https://github.com/vim/vim/commit/8c5a278fc508da6dfe50e69b6ee734451aa4eafb
Omit Test_wincolor(): there are later patches that touch that function.
Omit test_memory_usage.vim: a Lua test is used for that file.
Cherry-pick Test_issue_3969() from patch 8.1.0969.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir/test_startup.vim')
| -rw-r--r-- | src/nvim/testdir/test_startup.vim | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/src/nvim/testdir/test_startup.vim b/src/nvim/testdir/test_startup.vim index b30a5e7edb..e267d3f972 100644 --- a/src/nvim/testdir/test_startup.vim +++ b/src/nvim/testdir/test_startup.vim @@ -267,10 +267,9 @@ endfunc " Test the -V[N] argument to set the 'verbose' option to [N] func Test_V_arg() - if has('gui_running') - " Can't catch the output of gvim. - return - endif + " Can't catch the output of gvim. + CheckNotGui + let out = system(GetVimCommand() . ' --clean -es -X -V0 -c "set verbose?" -cq') call assert_equal(" verbose=0\n", out) @@ -543,10 +542,9 @@ endfunc func Test_invalid_args() - if !has('unix') || has('gui_running') - " can't get output of Vim. - return - endif + " must be able to get the output of Vim. + CheckUnix + CheckNotGui for opt in ['-Y', '--does-not-exist'] let out = split(system(GetVimCommand() .. ' ' .. opt), "\n") @@ -747,10 +745,9 @@ func Test_progpath() endfunc func Test_silent_ex_mode() - if !has('unix') || has('gui_running') - " can't get output of Vim. - return - endif + " must be able to get the output of Vim. + CheckUnix + CheckNotGui " This caused an ml_get error. let out = system(GetVimCommand() . ' -u NONE -es -c''set verbose=1|h|exe "%norm\<c-y>\<c-d>"'' -c cq') @@ -758,10 +755,9 @@ func Test_silent_ex_mode() endfunc func Test_default_term() - if !has('unix') || has('gui_running') - " can't get output of Vim. - return - endif + " must be able to get the output of Vim. + CheckUnix + CheckNotGui let save_term = $TERM let $TERM = 'unknownxxx' @@ -796,6 +792,15 @@ func Test_zzz_startinsert() call delete('Xtestout') endfunc +func Test_issue_3969() + " Can't catch the output of gvim. + CheckNotGui + + " Check that message is not truncated. + let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq') + call assert_equal('hello', out) +endfunc + func Test_start_with_tabs() if !CanRunVimInTerminal() return |