Skip to content

Commit b94340c

Browse files
committed
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)
1 parent f45938c commit b94340c

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/testdir/test_search.vim

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,13 +494,15 @@ func Test_search_cmdline_incsearch_highlight_attr()
494494
if h < 3
495495
return
496496
endif
497-
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3})
498497

499498
" Prepare buffer text
500-
let lines = ['abb vim vim vi', 'vimvivim']
501-
call term_sendkeys(g:buf, 'i' . join(lines, "\n") . "\<esc>gg0")
502-
call term_wait(g:buf, 200)
503-
call assert_equal(lines[0], term_getline(g:buf, 1))
499+
let g:lines = ['abb vim vim vi', 'vimvivim']
500+
call writefile(g:lines, 'Xsearch.txt')
501+
let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3})
502+
call WaitFor('g:lines[0] == term_getline(g:buf, 1)')
503+
call assert_equal(g:lines[0], term_getline(g:buf, 1))
504+
call assert_equal(g:lines[1], term_getline(g:buf, 2))
505+
unlet g:lines
504506

505507
" Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight
506508
call term_sendkeys(g:buf, ":set incsearch hlsearch\<cr>")
@@ -565,6 +567,7 @@ func Test_search_cmdline_incsearch_highlight_attr()
565567
call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr'))
566568
call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr'))
567569

570+
call delete('Xsearch.txt')
568571
bwipe!
569572
endfunc
570573

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1244,
764766
/**/
765767
1243,
766768
/**/

0 commit comments

Comments
 (0)