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.
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index cbe0084..5d5723c 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 @@
" 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 @@
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()