diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-12-24 15:17:00 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-12-24 15:17:00 +0100 |
commit | 49d68bf5e4d9306269b141f0576bbf44631f4ff0 (patch) | |
tree | d70b390d34e2b5f7d1943dcbdc7d84072c9797e7 | |
parent | 53989554a44caca0964376d60297f08ec257c53c (diff) | |
download | vim-git-49d68bf5e4d9306269b141f0576bbf44631f4ff0.tar.gz |
patch 8.2.0036: not enough test coverage for match functionsv8.2.0036
Problem: Not enough test coverage for match functions.
Solution: Add a few more test cases. (Dominique Pelle, closes #5394)
Add error number.
-rw-r--r-- | src/testdir/test_match.vim | 31 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index f55922b3e..59098f713 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -150,6 +150,21 @@ function Test_match() highlight MyGroup3 NONE endfunc +func Test_match_error() + call assert_fails('match Error', 'E475:') + call assert_fails('match Error /', 'E475:') + call assert_fails('4match Error /x/', 'E476:') + call assert_fails('match Error /x/ x', 'E488:') +endfunc + +func Test_matchadd_error() + call assert_fails("call matchadd('GroupDoesNotExist', 'X')", 'E28:') + 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:') +endfunc + func Test_matchaddpos() syntax on set hlsearch @@ -254,6 +269,17 @@ func Test_matchaddpos_using_negative_priority() set hlsearch& endfunc +func Test_matchaddpos_error() + call assert_fails("call matchaddpos('Error', 1)", 'E686:') + call assert_fails("call matchaddpos('Error', [1], 1, 1)", 'E798:') + call assert_fails("call matchaddpos('Error', [1], 1, 2)", 'E798:') + call assert_fails("call matchaddpos('Error', [1], 1, 0)", 'E799:') + 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:') +endfunc + func OtherWindowCommon() let lines =<< trim END call setline(1, 'Hello Vim world') @@ -278,6 +304,11 @@ func Test_matchdelete_other_window() call delete('XscriptMatchCommon') endfunc +func Test_matchdelete_error() + call assert_fails("call matchdelete(0)", 'E802:') + call assert_fails("call matchdelete(1, -1)", 'E957:') +endfunc + func Test_matchclear_other_window() if !CanRunVimInTerminal() throw 'Skipped: cannot make screendumps' diff --git a/src/version.c b/src/version.c index b1f40d4a2..6978a31f5 100644 --- a/src/version.c +++ b/src/version.c @@ -743,6 +743,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 36, +/**/ 35, /**/ 34, |