forked from aniani/vim
patch 8.2.0426: some errors were not tested for
Problem: Some errors were not tested for. Solution: Add tests. (Dominique Pelle, closes #5824)
This commit is contained in:
@@ -144,6 +144,7 @@ endfunc
|
|||||||
func Test_bdelete_cmd()
|
func Test_bdelete_cmd()
|
||||||
%bwipe!
|
%bwipe!
|
||||||
call assert_fails('bdelete 5', 'E516:')
|
call assert_fails('bdelete 5', 'E516:')
|
||||||
|
call assert_fails('1,1bdelete 1 2', 'E488:')
|
||||||
|
|
||||||
" Deleting a unlisted and unloaded buffer
|
" Deleting a unlisted and unloaded buffer
|
||||||
edit Xfile1
|
edit Xfile1
|
||||||
|
@@ -255,9 +255,10 @@ func Test_set_errors()
|
|||||||
call assert_fails('set regexpengine=3', 'E474:')
|
call assert_fails('set regexpengine=3', 'E474:')
|
||||||
call assert_fails('set history=10001', 'E474:')
|
call assert_fails('set history=10001', 'E474:')
|
||||||
call assert_fails('set numberwidth=21', 'E474:')
|
call assert_fails('set numberwidth=21', 'E474:')
|
||||||
call assert_fails('set colorcolumn=-a')
|
call assert_fails('set colorcolumn=-a', 'E474:')
|
||||||
call assert_fails('set colorcolumn=a')
|
call assert_fails('set colorcolumn=a', 'E474:')
|
||||||
call assert_fails('set colorcolumn=1,')
|
call assert_fails('set colorcolumn=1,', 'E474:')
|
||||||
|
call assert_fails('set colorcolumn=1;', 'E474:')
|
||||||
call assert_fails('set cmdheight=-1', 'E487:')
|
call assert_fails('set cmdheight=-1', 'E487:')
|
||||||
call assert_fails('set cmdwinheight=-1', 'E487:')
|
call assert_fails('set cmdwinheight=-1', 'E487:')
|
||||||
if has('conceal')
|
if has('conceal')
|
||||||
@@ -293,9 +294,13 @@ func Test_set_errors()
|
|||||||
call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:')
|
call assert_fails('set guicursor=i-ci,r-cr:h', 'E545:')
|
||||||
call assert_fails('set guicursor=i-ci', 'E545:')
|
call assert_fails('set guicursor=i-ci', 'E545:')
|
||||||
call assert_fails('set guicursor=x', 'E545:')
|
call assert_fails('set guicursor=x', 'E545:')
|
||||||
|
call assert_fails('set guicursor=x:', 'E546:')
|
||||||
call assert_fails('set guicursor=r-cr:horx', 'E548:')
|
call assert_fails('set guicursor=r-cr:horx', 'E548:')
|
||||||
call assert_fails('set guicursor=r-cr:hor0', 'E549:')
|
call assert_fails('set guicursor=r-cr:hor0', 'E549:')
|
||||||
endif
|
endif
|
||||||
|
if has('mouseshape')
|
||||||
|
call assert_fails('se mouseshape=i-r:x', 'E547:')
|
||||||
|
endif
|
||||||
call assert_fails('set backupext=~ patchmode=~', 'E589:')
|
call assert_fails('set backupext=~ patchmode=~', 'E589:')
|
||||||
call assert_fails('set winminheight=10 winheight=9', 'E591:')
|
call assert_fails('set winminheight=10 winheight=9', 'E591:')
|
||||||
call assert_fails('set winminwidth=10 winwidth=9', 'E592:')
|
call assert_fails('set winminwidth=10 winwidth=9', 'E592:')
|
||||||
|
@@ -653,6 +653,9 @@ endfunc
|
|||||||
|
|
||||||
" Test exiting current Tcl interpreter and re-creating one.
|
" Test exiting current Tcl interpreter and re-creating one.
|
||||||
func Test_tcl_exit()
|
func Test_tcl_exit()
|
||||||
|
call assert_fails('tcl exit 1 1', 'wrong # args: should be "exit ?returnCode?"')
|
||||||
|
call assert_fails('tcl exit x', 'expected integer but got "x"')
|
||||||
|
|
||||||
tcl set foo "foo"
|
tcl set foo "foo"
|
||||||
call assert_fails('tcl exit 3', 'E572: exit code 3')
|
call assert_fails('tcl exit 3', 'E572: exit code 3')
|
||||||
|
|
||||||
|
@@ -2330,6 +2330,10 @@ func Test_terminal_api_arg()
|
|||||||
unlet! g:called_arg
|
unlet! g:called_arg
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_terminal_invalid_arg()
|
||||||
|
call assert_fails('terminal ++xyz', 'E181:')
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_terminal_in_popup()
|
func Test_terminal_in_popup()
|
||||||
CheckRunVimInTerminal
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
@@ -174,6 +174,35 @@ func Test_window_split_edit_bufnr()
|
|||||||
%bw!
|
%bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_window_split_no_room()
|
||||||
|
" N horizontal windows need >= 2*N + 1 lines:
|
||||||
|
" - 1 line + 1 status line in each window
|
||||||
|
" - 1 Ex command line
|
||||||
|
"
|
||||||
|
" 2*N + 1 <= &lines
|
||||||
|
" N <= (lines - 1)/2
|
||||||
|
"
|
||||||
|
" Beyond that number of windows, E36: Not enough room is expected.
|
||||||
|
let hor_win_count = (&lines - 1)/2
|
||||||
|
let hor_split_count = hor_win_count - 1
|
||||||
|
for s in range(1, hor_split_count) | split | endfor
|
||||||
|
call assert_fails('split', 'E36:')
|
||||||
|
|
||||||
|
" N vertical windows need >= 2*(N - 1) + 1 columns:
|
||||||
|
" - 1 column + 1 separator for each window (except last window)
|
||||||
|
" - 1 column for the last window which does not have separator
|
||||||
|
"
|
||||||
|
" 2*(N - 1) + 1 <= &columns
|
||||||
|
" 2*N - 1 <= &columns
|
||||||
|
" N <= (&columns + 1)/2
|
||||||
|
let ver_win_count = (&columns + 1)/2
|
||||||
|
let ver_split_count = ver_win_count - 1
|
||||||
|
for s in range(1, ver_split_count) | vsplit | endfor
|
||||||
|
call assert_fails('vsplit', 'E36:')
|
||||||
|
|
||||||
|
%bw!
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_window_preview()
|
func Test_window_preview()
|
||||||
CheckFeature quickfix
|
CheckFeature quickfix
|
||||||
|
|
||||||
|
@@ -738,6 +738,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
426,
|
||||||
/**/
|
/**/
|
||||||
425,
|
425,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user