0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

patch 8.0.1244: search test does not work correctly on MS-Windows

Problem:    Search test does not work correctly on MS-Windows.
Solution:   Put text in a file instead of sending it to the terminal.
            (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2017-11-02 16:16:31 +01:00
parent f45938cc20
commit b94340c04f
2 changed files with 10 additions and 5 deletions

View File

@@ -494,13 +494,15 @@ func Test_search_cmdline_incsearch_highlight_attr()
if h < 3 if h < 3
return return
endif endif
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
" Prepare buffer text " Prepare buffer text
let lines = ['abb vim vim vi', 'vimvivim'] let g:lines = ['abb vim vim vi', 'vimvivim']
call term_sendkeys(g:buf, 'i' . join(lines, "\n") . "\<esc>gg0") call writefile(g:lines, 'Xsearch.txt')
call term_wait(g:buf, 200) let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3})
call assert_equal(lines[0], term_getline(g:buf, 1)) call WaitFor('g:lines[0] == term_getline(g:buf, 1)')
call assert_equal(g:lines[0], term_getline(g:buf, 1))
call assert_equal(g:lines[1], term_getline(g:buf, 2))
unlet g:lines
" Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight
call term_sendkeys(g:buf, ":set incsearch hlsearch\<cr>") call term_sendkeys(g:buf, ":set incsearch hlsearch\<cr>")
@@ -565,6 +567,7 @@ func Test_search_cmdline_incsearch_highlight_attr()
call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr'))
call delete('Xsearch.txt')
bwipe! bwipe!
endfunc endfunc

View File

@@ -761,6 +761,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1244,
/**/ /**/
1243, 1243,
/**/ /**/