comparison src/testdir/test_options.vim @ 23652:2a5b9801f2e2 v8.2.2368

patch 8.2.2368: insufficient tests for setting options Commit: https://github.com/vim/vim/commit/85773bf32b51cbe7e971c5ac11cb9c743bb7a38a Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 17 13:48:03 2021 +0100 patch 8.2.2368: insufficient tests for setting options Problem: Insufficient tests for setting options. Solution: Add a few tests. (Dominique Pell?, closes https://github.com/vim/vim/issues/7695)
author Bram Moolenaar <Bram@vim.org>
date Sun, 17 Jan 2021 14:00:04 +0100
parents 3105546b941f
children 8152b7daebad
comparison
equal deleted inserted replaced
23651:77fc8bae4d3e 23652:2a5b9801f2e2
369 call assert_fails('set comments=-', 'E524:') 369 call assert_fails('set comments=-', 'E524:')
370 call assert_fails('set comments=a', 'E525:') 370 call assert_fails('set comments=a', 'E525:')
371 call assert_fails('set foldmarker=x', 'E536:') 371 call assert_fails('set foldmarker=x', 'E536:')
372 call assert_fails('set commentstring=x', 'E537:') 372 call assert_fails('set commentstring=x', 'E537:')
373 call assert_fails('set complete=x', 'E539:') 373 call assert_fails('set complete=x', 'E539:')
374 call assert_fails('set rulerformat=%-', 'E539:')
375 call assert_fails('set rulerformat=%(', 'E542:')
376 call assert_fails('set rulerformat=%15(%%', 'E542:')
377 call assert_fails('set statusline=%$', 'E539:')
374 call assert_fails('set statusline=%{', 'E540:') 378 call assert_fails('set statusline=%{', 'E540:')
375 call assert_fails('set statusline=%(', 'E542:') 379 call assert_fails('set statusline=%(', 'E542:')
380 call assert_fails('set statusline=%)', 'E542:')
381
376 if has('cursorshape') 382 if has('cursorshape')
377 " This invalid value for 'guicursor' used to cause Vim to crash. 383 " This invalid value for 'guicursor' used to cause Vim to crash.
378 call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:') 384 call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:')
379 call assert_fails('set guicursor=i-ci', 'E545:') 385 call assert_fails('set guicursor=i-ci', 'E545:')
380 call assert_fails('set guicursor=x', 'E545:') 386 call assert_fails('set guicursor=x', 'E545:')
404 call assert_fails('set wrapscan=1', 'E474:') 410 call assert_fails('set wrapscan=1', 'E474:')
405 call assert_fails('set autoindent@', 'E488:') 411 call assert_fails('set autoindent@', 'E488:')
406 call assert_fails('set wildchar=<abc>', 'E474:') 412 call assert_fails('set wildchar=<abc>', 'E474:')
407 call assert_fails('set cmdheight=1a', 'E521:') 413 call assert_fails('set cmdheight=1a', 'E521:')
408 call assert_fails('set invcmdheight', 'E474:') 414 call assert_fails('set invcmdheight', 'E474:')
409 if has('python') && has('python3') 415 if has('python') || has('python3')
410 call assert_fails('set pyxversion=6', 'E474:') 416 call assert_fails('set pyxversion=6', 'E474:')
411 endif 417 endif
412 call assert_fails("let &tabstop='ab'", 'E521:') 418 call assert_fails("let &tabstop='ab'", 'E521:')
413 call assert_fails('set spellcapcheck=%\\(', 'E54:') 419 call assert_fails('set spellcapcheck=%\\(', 'E54:')
420 call assert_fails('set sessionoptions=curdir,sesdir', 'E474:')
421 call assert_fails('set foldmarker={{{,', 'E474:')
422 call assert_fails('set sessionoptions=sesdir,curdir', 'E474:')
423 call assert_fails('set listchars=trail:· ambiwidth=double', 'E834:')
424 set listchars&
425 call assert_fails('set fillchars=stl:· ambiwidth=double', 'E835:')
426 set fillchars&
427 call assert_fails('set fileencoding=latin1,utf-8', 'E474:')
428 set nomodifiable
429 call assert_fails('set fileencoding=latin1', 'E21:')
430 set modifiable&
414 endfunc 431 endfunc
415 432
416 func CheckWasSet(name) 433 func CheckWasSet(name)
417 let verb_cm = execute('verbose set ' .. a:name .. '?') 434 let verb_cm = execute('verbose set ' .. a:name .. '?')
418 call assert_match('Last set from.*test_options.vim', verb_cm) 435 call assert_match('Last set from.*test_options.vim', verb_cm)