diff src/testdir/test_match.vim @ 20178:2fb397573541

patch 8.2.0644: insufficient testing for invalid function arguments Commit: https://github.com/vim/vim/commit/99fa721944dda9d07c53c907c33466728df5c271 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 26 15:59:55 2020 +0200 patch 8.2.0644: insufficient testing for invalid function arguments Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5988)
author Bram Moolenaar <Bram@vim.org>
date Sun, 26 Apr 2020 16:00:04 +0200
parents c087099e9163
children 116c7bd5e980
line wrap: on
line diff
--- a/src/testdir/test_match.vim
+++ b/src/testdir/test_match.vim
@@ -163,6 +163,7 @@ func Test_matchadd_error()
   call assert_fails("call matchadd('Search', 'XXX', 1, 123, 1)", 'E715:')
   call assert_fails("call matchadd('Error', 'XXX', 1, 3)", 'E798:')
   call assert_fails("call matchadd('Error', 'XXX', 1, 0)", 'E799:')
+  call assert_fails("call matchadd('Error', 'XXX', [], 0)", 'E745:')
 endfunc
 
 func Test_matchaddpos()
@@ -278,6 +279,8 @@ func Test_matchaddpos_error()
   call assert_fails("call matchaddpos('Error', [1], 1, 5, {'window':12345})", 'E957:')
   " Why doesn't the following error have an error code E...?
   call assert_fails("call matchaddpos('Error', [{}])", 'E290:')
+  call assert_equal(-1, matchaddpos('Error', test_null_list()))
+  call assert_fails("call matchaddpos('Error', [1], [], 1)", 'E745:')
 endfunc
 
 func OtherWindowCommon()
@@ -334,5 +337,4 @@ func Test_matchadd_other_window()
   call delete('XscriptMatchCommon')
 endfunc
 
-
 " vim: shiftwidth=2 sts=2 expandtab