diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-07 23:07:07 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-07 23:07:07 +0200 |
commit | 8c5a278fc508da6dfe50e69b6ee734451aa4eafb (patch) | |
tree | 8a07c54e9ea8667a88f4aa2566e3c3c314727751 /src/testdir/test_options.vim | |
parent | b59e7357722d977830948572a395f0a175c7ded8 (diff) | |
download | vim-git-8c5a278fc508da6dfe50e69b6ee734451aa4eafb.tar.gz |
patch 8.1.1826: tests use hand coded feature and option checksv8.1.1826
Problem: Tests use hand coded feature and option checks.
Solution: Use the commands from check.vim in more tests.
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index cbe00840c..5d5723cca 100644 --- 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 - - " 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) - endif + CheckUnix + CheckNotGui + + " 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 + + " 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() |