Mercurial > vim
diff src/testdir/test_startup.vim @ 17657:0da9bc55c31a v8.1.1826
patch 8.1.1826: tests use hand coded feature and option checks
commit https://github.com/vim/vim/commit/8c5a278fc508da6dfe50e69b6ee734451aa4eafb
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Aug 7 23:07:07 2019 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 07 Aug 2019 23:15:07 +0200 |
parents | 40c4cb095d53 |
children | 85160a3649b9 |
line wrap: on
line diff
--- a/src/testdir/test_startup.vim +++ b/src/testdir/test_startup.vim @@ -2,6 +2,7 @@ source shared.vim source screendump.vim +source check.vim " Check that loading startup.vim works. func Test_startup_script() @@ -262,10 +263,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) @@ -395,10 +395,9 @@ func Test_A_F_H_arg() 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") @@ -599,10 +598,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') @@ -610,10 +608,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' @@ -649,10 +646,9 @@ func Test_zzz_startinsert() endfunc func Test_issue_3969() - if has('gui_running') - " Can't catch the output of gvim. - return - endif + " 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)