diff options
| author | rpigott <rpigott@berkeley.edu> | 2018-08-25 22:00:26 -0700 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2018-09-13 00:27:32 +0200 |
| commit | a5fe6d34a955b6c9b68cb737eef6fc33bd24c342 (patch) | |
| tree | d077abcf65331527a044c31e5ed6fca7eb957891 /src/nvim/testdir | |
| parent | 26b2c1fe156ca8504500abb5862bf6b8c6052f59 (diff) | |
| download | rneovim-a5fe6d34a955b6c9b68cb737eef6fc33bd24c342.tar.gz rneovim-a5fe6d34a955b6c9b68cb737eef6fc33bd24c342.tar.bz2 rneovim-a5fe6d34a955b6c9b68cb737eef6fc33bd24c342.zip | |
vim-patch:8.0.1161
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/shared.vim | 5 | ||||
| -rw-r--r-- | src/nvim/testdir/test_popup.vim | 28 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 4925b04a82..b2fe9413e8 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -1,5 +1,10 @@ " Functions shared by several tests. +" Only load this script once. +if exists('*WaitFor') + finish +endif + " {Nvim} " Filepath captured from output may be truncated, like this: " /home/va...estdir/Xtest-tmpdir/nvimxbXN4i/10 diff --git a/src/nvim/testdir/test_popup.vim b/src/nvim/testdir/test_popup.vim index 2191e3144f..6fd58a1483 100644 --- a/src/nvim/testdir/test_popup.vim +++ b/src/nvim/testdir/test_popup.vim @@ -1,5 +1,7 @@ " Test for completion menu +source shared.vim + let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] let g:setting = '' @@ -665,4 +667,30 @@ func Test_complete_CTRLN_startofbuffer() bwipe! endfunc +func Test_popup_and_window_resize() + if !has('terminal') || has('gui_running') + return + endif + let h = winheight(0) + if h < 15 + return + endif + let g:buf = term_start([$NVIM_PRG, '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3}) + call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>G") + call term_sendkeys(g:buf, "i\<c-x>") + call term_wait(g:buf, 100) + call term_sendkeys(g:buf, "\<c-v>") + call term_wait(g:buf, 100) + call assert_match('^!\s*$', term_getline(g:buf, 1)) + exe 'resize +' . (h - 1) + call term_wait(g:buf, 100) + redraw! + call WaitFor('"" == term_getline(g:buf, 1)') + call assert_equal('', term_getline(g:buf, 1)) + sleep 100m + call WaitFor('"^!" =~ term_getline(g:buf, term_getcursor(g:buf)[0] + 1)') + call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1)) + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |