comparison src/testdir/test_popupwin.vim @ 23217:0e4b3e7010df v8.2.2154

patch 8.2.2154: popupwin test for terminal buffer fails sometimes Commit: https://github.com/vim/vim/commit/0353f56ddb379e7f1a68172fa4743355e04df21e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 17 22:27:38 2020 +0100 patch 8.2.2154: popupwin test for terminal buffer fails sometimes Problem: Popupwin test for terminal buffer fails sometimes. Solution: Wait for the prompt to appear.
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Dec 2020 22:30:04 +0100
parents 62310124e265
children b545334ae654
comparison
equal deleted inserted replaced
23216:47128eac082d 23217:0e4b3e7010df
2671 " open help window to test that :help below fails 2671 " open help window to test that :help below fails
2672 help 2672 help
2673 2673
2674 let termbuf = term_start(&shell, #{hidden: 1}) 2674 let termbuf = term_start(&shell, #{hidden: 1})
2675 let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10, border: []}) 2675 let winid = popup_create(termbuf, #{minwidth: 40, minheight: 10, border: []})
2676 " Wait for shell to start and show a prompt 2676 " Wait for shell to start
2677 call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))}) 2677 call WaitForAssert({-> assert_equal("run", job_status(term_getjob(termbuf)))})
2678 sleep 20m 2678 " Wait for a prompt (see border char first, then space after prompt)
2679 call WaitForAssert({ -> assert_equal(' ', screenstring(screenrow(), screencol() - 1))})
2679 2680
2680 " When typing a character, the cursor is after it. 2681 " When typing a character, the cursor is after it.
2681 call feedkeys("x", 'xt') 2682 call feedkeys("x", 'xt')
2682 sleep 10m 2683 call term_wait(termbuf)
2683 redraw 2684 redraw
2684 call WaitForAssert({ -> assert_equal('x', screenstring(screenrow(), screencol() - 1))}) 2685 call WaitForAssert({ -> assert_equal('x', screenstring(screenrow(), screencol() - 1))})
2685 call feedkeys("\<BS>", 'xt') 2686 call feedkeys("\<BS>", 'xt')
2686 2687
2687 " Check this doesn't crash 2688 " Check this doesn't crash