diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2019-12-31 04:03:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-31 04:03:11 +0100 |
| commit | e922576bdd6abd6736417343121120b289079565 (patch) | |
| tree | cdefff491e487c8aa6d6f1c281eca5f921a30aea /src/nvim/testdir | |
| parent | 22a92a59a68e2b0928a6243c0888b56608a8f8d8 (diff) | |
| parent | 4bd51d8988b0af76a8c9e8cb38c537fc53346c20 (diff) | |
| download | rneovim-e922576bdd6abd6736417343121120b289079565.tar.gz rneovim-e922576bdd6abd6736417343121120b289079565.tar.bz2 rneovim-e922576bdd6abd6736417343121120b289079565.zip | |
Merge #11637 from janlazo/vim-8.1.1739
vim-patch:8.1.{1739,1741},8.2.0063
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_match.vim | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_match.vim b/src/nvim/testdir/test_match.vim index 90dfcf952d..c134cfb1c0 100644 --- a/src/nvim/testdir/test_match.vim +++ b/src/nvim/testdir/test_match.vim @@ -1,6 +1,8 @@ " Test for :match, :2match, :3match, clearmatches(), getmatches(), matchadd(), " matchaddpos(), matcharg(), matchdelete(), and setmatches(). +source screendump.vim + function Test_match() highlight MyGroup1 term=bold ctermbg=red guibg=red highlight MyGroup2 term=italic ctermbg=green guibg=green @@ -248,4 +250,55 @@ func Test_matchaddpos_using_negative_priority() set hlsearch& endfunc +func OtherWindowCommon() + let lines =<< trim END + call setline(1, 'Hello Vim world') + let mid = matchadd('Error', 'world', 1) + let winid = win_getid() + new + END + call writefile(lines, 'XscriptMatchCommon') + let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12}) + call term_wait(buf) + return buf +endfunc + +func Test_matchdelete_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() + call term_sendkeys(buf, ":call matchdelete(mid, winid)\<CR>") + call VerifyScreenDump(buf, 'Test_matchdelete_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') +endfunc + +func Test_matchclear_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() + call term_sendkeys(buf, ":call clearmatches(winid)\<CR>") + call VerifyScreenDump(buf, 'Test_matchclear_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') +endfunc + +func Test_matchadd_other_window() + if !CanRunVimInTerminal() + throw 'Skipped: cannot make screendumps' + endif + let buf = OtherWindowCommon() + call term_sendkeys(buf, ":call matchadd('Search', 'Hello', 1, -1, #{window: winid})\<CR>") + call term_sendkeys(buf, ":\<CR>") + call VerifyScreenDump(buf, 'Test_matchadd_1', {}) + + call StopVimInTerminal(buf) + call delete('XscriptMatchCommon') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |