diff options
| author | Matthieu Coudron <mattator@gmail.com> | 2020-05-23 14:33:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-23 14:33:33 +0200 |
| commit | 97bcab8f5eeb8c5b2627fdfc3adad2682bb3681e (patch) | |
| tree | 1a91f81879d226f1b5e38251bb56ceca5c184639 /src/nvim/testdir/test_match.vim | |
| parent | ef8f965c64c157de728124a84281630cfb234002 (diff) | |
| parent | 0666b23d65c6dd6880166db0d2ed6a150b0554d0 (diff) | |
| download | rneovim-97bcab8f5eeb8c5b2627fdfc3adad2682bb3681e.tar.gz rneovim-97bcab8f5eeb8c5b2627fdfc3adad2682bb3681e.tar.bz2 rneovim-97bcab8f5eeb8c5b2627fdfc3adad2682bb3681e.zip | |
Merge pull request #12327 from janlazo/vim-8.2.0766
vim-patch:8.1.2228,8.2.{36,37,766,810}
Diffstat (limited to 'src/nvim/testdir/test_match.vim')
| -rw-r--r-- | src/nvim/testdir/test_match.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 7a1894bc16..09448ca71b 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -149,6 +149,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 @@ -263,6 +278,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', [{}])", 'E5031:') +endfunc + func OtherWindowCommon() let lines =<< trim END call setline(1, 'Hello Vim world') @@ -288,6 +314,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' |