aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_options.vim
diff options
context:
space:
mode:
Diffstat (limited to 'test/old/testdir/test_options.vim')
-rw-r--r--test/old/testdir/test_options.vim59
1 files changed, 54 insertions, 5 deletions
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
index b6bdb1be52..2479f0ca51 100644
--- a/test/old/testdir/test_options.vim
+++ b/test/old/testdir/test_options.vim
@@ -496,7 +496,7 @@ func Test_set_completion_string_values()
" but don't exhaustively validate their results.
call assert_equal('single', getcompletion('set ambw=', 'cmdline')[0])
call assert_match('light\|dark', getcompletion('set bg=', 'cmdline')[1])
- call assert_equal('indent', getcompletion('set backspace=', 'cmdline')[0])
+ call assert_equal('indent,eol,start', getcompletion('set backspace=', 'cmdline')[0])
call assert_equal('yes', getcompletion('set backupcopy=', 'cmdline')[1])
call assert_equal('backspace', getcompletion('set belloff=', 'cmdline')[1])
call assert_equal('min:', getcompletion('set briopt=', 'cmdline')[1])
@@ -504,7 +504,8 @@ func Test_set_completion_string_values()
call assert_equal('current', getcompletion('set browsedir=', 'cmdline')[1])
endif
call assert_equal('unload', getcompletion('set bufhidden=', 'cmdline')[1])
- call assert_equal('nowrite', getcompletion('set buftype=', 'cmdline')[1])
+ "call assert_equal('nowrite', getcompletion('set buftype=', 'cmdline')[1])
+ call assert_equal('help', getcompletion('set buftype=', 'cmdline')[1])
call assert_equal('internal', getcompletion('set casemap=', 'cmdline')[1])
if exists('+clipboard')
" call assert_match('unnamed', getcompletion('set clipboard=', 'cmdline')[1])
@@ -644,6 +645,10 @@ func Test_set_completion_string_values()
" call feedkeys(":set hl=8b i\<Left>\<Left>\<Tab>\<C-B>\"\<CR>", 'xt')
" call assert_equal("\"set hl=8bi i", @:)
+ " messagesopt
+ call assert_equal(['history:', 'hit-enter', 'wait:'],
+ \ getcompletion('set messagesopt+=', 'cmdline')->sort())
+
"
" Test flag lists
"
@@ -706,6 +711,10 @@ func Test_set_completion_string_values()
" Test empty option
set diffopt=
call assert_equal([], getcompletion('set diffopt-=', 'cmdline'))
+ " Test all possible values
+ call assert_equal(['filler', 'context:', 'iblank', 'icase', 'iwhite', 'iwhiteall', 'iwhiteeol', 'horizontal',
+ \ 'vertical', 'closeoff', 'hiddenoff', 'foldcolumn:', 'followwrap', 'internal', 'indent-heuristic', 'algorithm:', 'linematch:'],
+ \ getcompletion('set diffopt=', 'cmdline'))
set diffopt&
" Test escaping output
@@ -743,7 +752,6 @@ func Test_set_option_errors()
call assert_fails('set backupcopy=', 'E474:')
call assert_fails('set regexpengine=3', 'E474:')
call assert_fails('set history=10001', 'E474:')
- call assert_fails('set msghistory=10001', 'E474:')
call assert_fails('set numberwidth=21', 'E474:')
call assert_fails('set colorcolumn=-a', 'E474:')
call assert_fails('set colorcolumn=a', 'E474:')
@@ -757,7 +765,6 @@ func Test_set_option_errors()
endif
call assert_fails('set helpheight=-1', 'E487:')
call assert_fails('set history=-1', 'E487:')
- call assert_fails('set msghistory=-1', 'E487:')
call assert_fails('set report=-1', 'E487:')
call assert_fails('set shiftwidth=-1', 'E487:')
call assert_fails('set sidescroll=-1', 'E487:')
@@ -2252,16 +2259,57 @@ func Test_opt_default()
call assert_equal('vt', &formatoptions)
set formatoptions&vim
call assert_equal('tcq', &formatoptions)
+
+ call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
+ set fencs=latin1
+ set fencs&
+ call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
+ set fencs=latin1
+ set all&
+ call assert_equal('ucs-bom,utf-8,default,latin1', &fencs)
endfunc
" Test for the 'cmdheight' option
-func Test_cmdheight()
+func Test_opt_cmdheight()
%bw!
let ht = &lines
set cmdheight=9999
call assert_equal(1, winheight(0))
call assert_equal(ht - 1, &cmdheight)
set cmdheight&
+
+ " The status line should be taken into account.
+ set laststatus=2
+ set cmdheight=9999
+ call assert_equal(ht - 2, &cmdheight)
+ set cmdheight& laststatus=1 " Accommodate Nvim default
+
+ " The tabline should be taken into account only non-GUI.
+ set showtabline=2
+ set cmdheight=9999
+ if has('gui_running')
+ call assert_equal(ht - 1, &cmdheight)
+ else
+ call assert_equal(ht - 2, &cmdheight)
+ endif
+ set cmdheight& showtabline&
+
+ " The 'winminheight' should be taken into account.
+ set winheight=3 winminheight=3
+ split
+ set cmdheight=9999
+ call assert_equal(ht - 8, &cmdheight)
+ %bw!
+ set cmdheight& winminheight& winheight&
+
+ " Only the windows in the current tabpage are taken into account.
+ set winheight=3 winminheight=3 showtabline=0
+ split
+ tabnew
+ set cmdheight=9999
+ call assert_equal(ht - 3, &cmdheight)
+ %bw!
+ set cmdheight& winminheight& winheight& showtabline&
endfunc
" To specify a control character as an option value, '^' can be used
@@ -2476,6 +2524,7 @@ func Test_string_option_revert_on_failure()
\ ['lispoptions', 'expr:1', 'a123'],
\ ['listchars', 'tab:->', 'tab:'],
\ ['matchpairs', '<:>', '<:'],
+ \ ['messagesopt', 'hit-enter,history:100', 'a123'],
\ ['mkspellmem', '100000,1000,100', '100000'],
\ ['mouse', 'nvi', 'z'],
\ ['mousemodel', 'extend', 'a123'],