comparison src/testdir/test_popup.vim @ 12574:575d530df053 v8.0.1165

patch 8.0.1165: popup test is still flaky commit https://github.com/vim/vim/commit/f52c38315669f85bbcf3bd74c590148bf588f6c6 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 30 16:49:19 2017 +0200 patch 8.0.1165: popup test is still flaky Problem: Popup test is still flaky. Solution: Add a term_wait() call. (Ozaki Kiichi)
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Sep 2017 17:00:04 +0200
parents 871dc52ee7d7
children 0d29a806e6d1
comparison
equal deleted inserted replaced
12573:e71f6b9fe565 12574:575d530df053
643 if h < 15 643 if h < 15
644 return 644 return
645 endif 645 endif
646 let g:buf = term_start([$VIMPROG, '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3}) 646 let g:buf = term_start([$VIMPROG, '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3})
647 call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>G") 647 call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>G")
648 call term_wait(g:buf, 100)
648 call term_sendkeys(g:buf, "i\<c-x>") 649 call term_sendkeys(g:buf, "i\<c-x>")
649 call term_wait(g:buf, 100) 650 call term_wait(g:buf, 100)
650 call term_sendkeys(g:buf, "\<c-v>") 651 call term_sendkeys(g:buf, "\<c-v>")
651 call term_wait(g:buf, 100) 652 call term_wait(g:buf, 100)
653 " popup first entry "!" must be at the top
652 call WaitFor('term_getline(g:buf, 1) =~ "^!"') 654 call WaitFor('term_getline(g:buf, 1) =~ "^!"')
653 call assert_match('^!\s*$', term_getline(g:buf, 1)) 655 call assert_match('^!\s*$', term_getline(g:buf, 1))
654 exe 'resize +' . (h - 1) 656 exe 'resize +' . (h - 1)
655 call term_wait(g:buf, 100) 657 call term_wait(g:buf, 100)
656 redraw! 658 redraw!
659 " popup shifted down, first line is now empty
657 call WaitFor('term_getline(g:buf, 1) == ""') 660 call WaitFor('term_getline(g:buf, 1) == ""')
658 call assert_equal('', term_getline(g:buf, 1)) 661 call assert_equal('', term_getline(g:buf, 1))
659 sleep 100m 662 sleep 100m
663 " popup is below cursor line and shows first match "!"
660 call WaitFor('term_getline(g:buf, term_getcursor(g:buf)[0] + 1) =~ "^!"') 664 call WaitFor('term_getline(g:buf, term_getcursor(g:buf)[0] + 1) =~ "^!"')
661 call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1)) 665 call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1))
666 " cursor line also shows !
667 call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0]))
662 bwipe! 668 bwipe!
663 endfunc 669 endfunc
664 670
665 " vim: shiftwidth=2 sts=2 expandtab 671 " vim: shiftwidth=2 sts=2 expandtab