Mercurial > vim
diff src/testdir/test_options.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 | f1c7b7a4d9e4 |
children | 8a2fb21c23c0 |
line wrap: on
line diff
--- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -1,5 +1,7 @@ " Test for options +source check.vim + func Test_whichwrap() set whichwrap=b,s call assert_equal('b,s', &whichwrap) @@ -296,9 +298,8 @@ endfunc " Must be executed before other tests that set 'term'. func Test_000_term_option_verbose() - if has('gui_running') - return - endif + CheckNotGui + let verb_cm = execute('verbose set t_cm') call assert_notmatch('Last set from', verb_cm) @@ -310,34 +311,35 @@ func Test_000_term_option_verbose() endfunc func Test_set_ttytype() - if !has('gui_running') && has('unix') - " Setting 'ttytype' used to cause a double-free when exiting vim and - " when vim is compiled with -DEXITFREE. - set ttytype=ansi - call assert_equal('ansi', &ttytype) - call assert_equal(&ttytype, &term) - set ttytype=xterm - call assert_equal('xterm', &ttytype) - call assert_equal(&ttytype, &term) - " "set ttytype=" gives E522 instead of E529 - " in travis on some builds. Why? Catch both for now - try - set ttytype= - call assert_report('set ttytype= did not fail') - catch /E529\|E522/ - endtry + CheckUnix + CheckNotGui - " Some systems accept any terminal name and return dumb settings, - " check for failure of finding the entry and for missing 'cm' entry. - try - set ttytype=xxx - call assert_report('set ttytype=xxx did not fail') - catch /E522\|E437/ - endtry + " Setting 'ttytype' used to cause a double-free when exiting vim and + " when vim is compiled with -DEXITFREE. + set ttytype=ansi + call assert_equal('ansi', &ttytype) + call assert_equal(&ttytype, &term) + set ttytype=xterm + call assert_equal('xterm', &ttytype) + call assert_equal(&ttytype, &term) + " "set ttytype=" gives E522 instead of E529 + " in travis on some builds. Why? Catch both for now + try + set ttytype= + call assert_report('set ttytype= did not fail') + catch /E529\|E522/ + endtry - set ttytype& - call assert_equal(&ttytype, &term) - endif + " Some systems accept any terminal name and return dumb settings, + " check for failure of finding the entry and for missing 'cm' entry. + try + set ttytype=xxx + call assert_report('set ttytype=xxx did not fail') + catch /E522\|E437/ + endtry + + set ttytype& + call assert_equal(&ttytype, &term) endfunc func Test_set_all()