summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-30 14:29:45 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-30 14:29:45 +0200
commit8c2a600f72ca930841a5f4f7eac22884238afaf3 (patch)
treee8c7ce6db4d5ad9aac0cc7bd2d3f5581e551704a /src/testdir
parent1714696600f2859f897f4ffb33cedb5de09eded3 (diff)
downloadvim-git-8c2a600f72ca930841a5f4f7eac22884238afaf3.tar.gz
patch 8.1.1422: popup_getoptions() not implemented yetv8.1.1422
Problem: Popup_getoptions() not implemented yet. Solution: Implement it. (closes #4452)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_popupwin.vim47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 4511cd1ac..a11e5a03f 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -108,16 +108,19 @@ func Test_popup_hide()
redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('world', line)
+ call assert_equal(1, popup_getposition(winid).visible)
call popup_hide(winid)
redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('hello', line)
+ call assert_equal(0, popup_getposition(winid).visible)
call popup_show(winid)
redraw
let line = join(map(range(1, 5), 'screenstring(1, v:val)'), '')
call assert_equal('world', line)
+ call assert_equal(1, popup_getposition(winid).visible)
call popup_close(winid)
@@ -178,6 +181,7 @@ func Test_popup_getposition()
call assert_equal(3, res.col)
call assert_equal(10, res.width)
call assert_equal(11, res.height)
+ call assert_equal(1, res.visible)
call popup_close(winid)
endfunc
@@ -215,5 +219,48 @@ func Test_popup_wraps()
call assert_equal(test[2], position.height)
call popup_close(winid)
+ call assert_equal({}, popup_getposition(winid))
endfor
endfunc
+
+func Test_popup_getoptions()
+ let winid = popup_create('hello', {
+ \ 'line': 2,
+ \ 'col': 3,
+ \ 'minwidth': 10,
+ \ 'minheight': 11,
+ \ 'maxwidth': 20,
+ \ 'maxheight': 21,
+ \ 'zindex': 100,
+ \ 'time': 5000,
+ \})
+ redraw
+ let res = popup_getoptions(winid)
+ call assert_equal(2, res.line)
+ call assert_equal(3, res.col)
+ call assert_equal(10, res.minwidth)
+ call assert_equal(11, res.minheight)
+ call assert_equal(20, res.maxwidth)
+ call assert_equal(21, res.maxheight)
+ call assert_equal(100, res.zindex)
+ if has('timers')
+ call assert_equal(5000, res.time)
+ endif
+ call popup_close(winid)
+
+ let winid = popup_create('hello', {})
+ redraw
+ let res = popup_getoptions(winid)
+ call assert_equal(0, res.line)
+ call assert_equal(0, res.col)
+ call assert_equal(0, res.minwidth)
+ call assert_equal(0, res.minheight)
+ call assert_equal(0, res.maxwidth)
+ call assert_equal(0, res.maxheight)
+ call assert_equal(50, res.zindex)
+ if has('timers')
+ call assert_equal(0, res.time)
+ endif
+ call popup_close(winid)
+ call assert_equal({}, popup_getoptions(winid))
+endfunc