aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_match.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-05 07:34:06 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-05 09:25:31 +0800
commite30929cda5cad8afb384cdb5b1ce62758dca6bde (patch)
tree5862bf8489efc9facfa7636f7cea19f61f389e51 /src/nvim/testdir/test_match.vim
parentb7b4914fe44b4a192379659dbcb958c63b82327c (diff)
downloadrneovim-e30929cda5cad8afb384cdb5b1ce62758dca6bde.tar.gz
rneovim-e30929cda5cad8afb384cdb5b1ce62758dca6bde.tar.bz2
rneovim-e30929cda5cad8afb384cdb5b1ce62758dca6bde.zip
vim-patch:8.2.0644: insufficient testing for invalid function arguments
Problem: Insufficient testing for invalid function arguments. Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#5988) https://github.com/vim/vim/commit/99fa721944dda9d07c53c907c33466728df5c271 Omit test_listener.vim: changed again in patch 8.2.1183. Omit test_textprop.vim: changed again in patch 8.2.1183. Cherry-pick quickfix feature checks from patch 8.1.2373. Omit Test_saveas() change: duplicate and removed in patch 8.2.0866.
Diffstat (limited to 'src/nvim/testdir/test_match.vim')
-rw-r--r--src/nvim/testdir/test_match.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim
index fe931fefb2..352493de9c 100644
--- a/src/nvim/testdir/test_match.vim
+++ b/src/nvim/testdir/test_match.vim
@@ -160,12 +160,14 @@ endfunc
func Test_matchadd_error()
call clearmatches()
" Nvim: not an error anymore:
+ " call assert_fails("call matchadd('GroupDoesNotExist', 'X')", 'E28:')
call matchadd('GroupDoesNotExist', 'X')
call assert_equal([{'group': 'GroupDoesNotExist', 'pattern': 'X', 'priority': 10, 'id': 1206}], getmatches())
call assert_fails("call matchadd('Search', '\\(')", 'E475:')
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()
@@ -305,7 +307,10 @@ func Test_matchaddpos_error()
call assert_fails("call matchaddpos('Error', [1], 1, 123, 1)", 'E715:')
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_fails("call matchaddpos('Error', [{}])", 'E5031:')
+ call assert_equal(-1, matchaddpos('Error', v:_null_list))
+ call assert_fails("call matchaddpos('Error', [1], [], 1)", 'E745:')
endfunc
func OtherWindowCommon()
@@ -362,5 +367,4 @@ func Test_matchadd_other_window()
call delete('XscriptMatchCommon')
endfunc
-
" vim: shiftwidth=2 sts=2 expandtab