0
0
mirror of https://github.com/vim/vim.git synced 2025-10-15 07:14:09 -04:00

patch 8.2.0644: insufficient testing for invalid function arguments

Problem:    Insufficient testing for invalid function arguments.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #5988)
This commit is contained in:
Bram Moolenaar
2020-04-26 15:59:55 +02:00
parent e297802d6d
commit 99fa721944
18 changed files with 116 additions and 10 deletions

View File

@@ -445,6 +445,7 @@ func Test_win_screenpos()
call assert_equal([1, 32], win_screenpos(2))
call assert_equal([12, 1], win_screenpos(3))
call assert_equal([0, 0], win_screenpos(4))
call assert_fails('let l = win_screenpos([])', 'E745:')
only
endfunc
@@ -694,6 +695,7 @@ func Test_relative_cursor_position_in_one_line_window()
only!
bwipe!
call assert_fails('call winrestview(test_null_dict())', 'E474:')
endfunc
func Test_relative_cursor_position_after_move_and_resize()
@@ -870,6 +872,10 @@ func Test_winnr()
call assert_fails("echo winnr('ll')", 'E15:')
call assert_fails("echo winnr('5')", 'E15:')
call assert_equal(4, winnr('0h'))
call assert_fails("let w = winnr([])", 'E730:')
call assert_equal('unknown', win_gettype(-1))
call assert_equal(-1, winheight(-1))
call assert_equal(-1, winwidth(-1))
tabnew
call assert_equal(8, tabpagewinnr(1, 'j'))
@@ -890,6 +896,7 @@ func Test_winrestview()
call assert_equal(view, winsaveview())
bwipe!
call assert_fails('call winrestview(test_null_dict())', 'E474:')
endfunc
func Test_win_splitmove()
@@ -920,6 +927,7 @@ func Test_win_splitmove()
call assert_equal(bufname(winbufnr(2)), 'b')
call assert_equal(bufname(winbufnr(3)), 'a')
call assert_equal(bufname(winbufnr(4)), 'd')
call assert_fails('call win_splitmove(winnr(), winnr("k"), test_null_dict())', 'E474:')
only | bd
call assert_fails('call win_splitmove(winnr(), 123)', 'E957:')