comparison 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
comparison
equal deleted inserted replaced
17656:2adce9da20d8 17657:0da9bc55c31a
1 " Test for options 1 " Test for options
2
3 source check.vim
2 4
3 func Test_whichwrap() 5 func Test_whichwrap()
4 set whichwrap=b,s 6 set whichwrap=b,s
5 call assert_equal('b,s', &whichwrap) 7 call assert_equal('b,s', &whichwrap)
6 8
294 call assert_fails('set t_foo=', 'E846:') 296 call assert_fails('set t_foo=', 'E846:')
295 endfunc 297 endfunc
296 298
297 " Must be executed before other tests that set 'term'. 299 " Must be executed before other tests that set 'term'.
298 func Test_000_term_option_verbose() 300 func Test_000_term_option_verbose()
299 if has('gui_running') 301 CheckNotGui
300 return 302
301 endif
302 let verb_cm = execute('verbose set t_cm') 303 let verb_cm = execute('verbose set t_cm')
303 call assert_notmatch('Last set from', verb_cm) 304 call assert_notmatch('Last set from', verb_cm)
304 305
305 let term_save = &term 306 let term_save = &term
306 set term=ansi 307 set term=ansi
308 call assert_match('Last set from.*test_options.vim', verb_cm) 309 call assert_match('Last set from.*test_options.vim', verb_cm)
309 let &term = term_save 310 let &term = term_save
310 endfunc 311 endfunc
311 312
312 func Test_set_ttytype() 313 func Test_set_ttytype()
313 if !has('gui_running') && has('unix') 314 CheckUnix
314 " Setting 'ttytype' used to cause a double-free when exiting vim and 315 CheckNotGui
315 " when vim is compiled with -DEXITFREE. 316
316 set ttytype=ansi 317 " Setting 'ttytype' used to cause a double-free when exiting vim and
317 call assert_equal('ansi', &ttytype) 318 " when vim is compiled with -DEXITFREE.
318 call assert_equal(&ttytype, &term) 319 set ttytype=ansi
319 set ttytype=xterm 320 call assert_equal('ansi', &ttytype)
320 call assert_equal('xterm', &ttytype) 321 call assert_equal(&ttytype, &term)
321 call assert_equal(&ttytype, &term) 322 set ttytype=xterm
322 " "set ttytype=" gives E522 instead of E529 323 call assert_equal('xterm', &ttytype)
323 " in travis on some builds. Why? Catch both for now 324 call assert_equal(&ttytype, &term)
324 try 325 " "set ttytype=" gives E522 instead of E529
325 set ttytype= 326 " in travis on some builds. Why? Catch both for now
326 call assert_report('set ttytype= did not fail') 327 try
327 catch /E529\|E522/ 328 set ttytype=
328 endtry 329 call assert_report('set ttytype= did not fail')
329 330 catch /E529\|E522/
330 " Some systems accept any terminal name and return dumb settings, 331 endtry
331 " check for failure of finding the entry and for missing 'cm' entry. 332
332 try 333 " Some systems accept any terminal name and return dumb settings,
333 set ttytype=xxx 334 " check for failure of finding the entry and for missing 'cm' entry.
334 call assert_report('set ttytype=xxx did not fail') 335 try
335 catch /E522\|E437/ 336 set ttytype=xxx
336 endtry 337 call assert_report('set ttytype=xxx did not fail')
337 338 catch /E522\|E437/
338 set ttytype& 339 endtry
339 call assert_equal(&ttytype, &term) 340
340 endif 341 set ttytype&
342 call assert_equal(&ttytype, &term)
341 endfunc 343 endfunc
342 344
343 func Test_set_all() 345 func Test_set_all()
344 set tw=75 346 set tw=75
345 set iskeyword=a-z,A-Z 347 set iskeyword=a-z,A-Z