aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-09-13 00:28:04 +0200
committerJustin M. Keyes <justinkz@gmail.com>2018-09-13 00:29:00 +0200
commit656648d8557d7a495775b2de565a96275549a4c9 (patch)
tree2b6a760539b02e82682406326f36dba19506cf43 /src/nvim/testdir
parent7a26b9b62b5c5c69b4ea700eb8541721a763e734 (diff)
parent59c5c4f00693deca7ac4f8fce2ba10ab3f8490f1 (diff)
downloadrneovim-656648d8557d7a495775b2de565a96275549a4c9.tar.gz
rneovim-656648d8557d7a495775b2de565a96275549a4c9.tar.bz2
rneovim-656648d8557d7a495775b2de565a96275549a4c9.zip
Merge #8913 'popupmenu placement'
close #8913
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/shared.vim5
-rw-r--r--src/nvim/testdir/test_popup.vim28
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