From e8df2a012b3d54c3c39bdc8abbfdcdec6a402cf8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 14:55:13 +0800 Subject: vim-patch:8.2.0186: a couple of tests may fail when features are missing Problem: A couple of tests may fail when features are missing. Solution: Check for features. (Dominique Pelle, closes vim/vim#5561) https://github.com/vim/vim/commit/705724e430abd10ffdd5f1a2bb5a8f9223ff5cdd Just copy the two 'wincolor' test functions from Vim. Co-authored-by: Bram Moolenaar --- test/old/testdir/test_highlight.vim | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index 14c208521b..4026302a5b 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -593,6 +593,57 @@ func Test_cursorline_with_visualmode() call delete('Xtest_cursorline_with_visualmode') endfunc +func Test_wincolor() + CheckScreendump + + let lines =<< trim END + set cursorline cursorcolumn rnu + call setline(1, ["","1111111111","22222222222","3 here 3","","the cat is out of the bag"]) + set wincolor=Pmenu + hi CatLine guifg=green ctermfg=green + hi Reverse gui=reverse cterm=reverse + syn match CatLine /^the.*/ + call prop_type_add("foo", {"highlight": "Reverse", "combine": 1}) + call prop_add(6, 12, {"type": "foo", "end_col": 15}) + /here + END + call writefile(lines, 'Xtest_wincolor') + let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8}) + call term_wait(buf) + call term_sendkeys(buf, "2G5lvj") + call term_wait(buf) + + call VerifyScreenDump(buf, 'Test_wincolor_01', {}) + + " clean up + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('Xtest_wincolor') +endfunc + +func Test_wincolor_listchars() + CheckScreendump + CheckFeature conceal + + let lines =<< trim END + call setline(1, ["one","\t\tsome random text enough long to show 'extends' and 'precedes' includingnbsps, preceding tabs and trailing spaces ","three"]) + set wincolor=Todo + set nowrap cole=1 cocu+=n + set list lcs=eol:$,tab:>-,space:.,trail:_,extends:>,precedes:<,conceal:*,nbsp:# + call matchadd('Conceal', 'text') + normal 2G5zl + END + call writefile(lines, 'Xtest_wincolorlcs') + let buf = RunVimInTerminal('-S Xtest_wincolorlcs', {'rows': 8}) + + call VerifyScreenDump(buf, 'Test_wincolor_lcs', {}) + + " clean up + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('Xtest_wincolorlcs') +endfunc + func Test_cursorcolumn_insert_on_tab() CheckScreendump -- cgit