aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2019-03-16 16:00:38 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-03-16 21:44:15 +0100
commitb557654f36c4c3c4352c838d0d8d1df3e5340655 (patch)
tree2e1678da2036470f81c81b23a6f8de9ea5c4ef38
parent073ab7cda83ca2f804b02e10bc6be17a02c4d3c9 (diff)
downloadrneovim-b557654f36c4c3c4352c838d0d8d1df3e5340655.tar.gz
rneovim-b557654f36c4c3c4352c838d0d8d1df3e5340655.tar.bz2
rneovim-b557654f36c4c3c4352c838d0d8d1df3e5340655.zip
api: add tests for new code paths
-rw-r--r--test/functional/ui/float_spec.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 6f68c08800..06d3b6bdda 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -152,6 +152,13 @@ describe('floating windows', function()
end
end)
+ it('return their configuration', function()
+ local buf = meths.create_buf(false, false)
+ local win = meths.open_win(buf, false, {relative='editor', width=20, height=2, row=3, col=5})
+ local expected = {anchor='NW', col=5, external=false, focusable=true, height=2, relative='editor', row=3, width=20}
+ eq(expected, meths.win_get_config(win))
+ end)
+
it('defaults to nonumber and NormalFloat highlight', function()
command('set number')
command('hi NormalFloat guibg=#333333')
@@ -243,6 +250,10 @@ describe('floating windows', function()
meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor',row=0,col=0,anchor='bottom'}))
eq({false, "All of 'relative', 'row', and 'col' has to be specified at once"},
meth_pcall(meths.open_win,buf, false, {width=20,height=2,relative='editor'}))
+ eq({false, "'width' key must be a positive Integer"},
+ meth_pcall(meths.open_win,buf, false, {width=-1,height=2,relative='editor'}))
+ eq({false, "'height' key must be a positive Integer"},
+ meth_pcall(meths.open_win,buf, false, {width=20,height=-1,relative='editor'}))
end)
it('can be placed relative window or cursor', function()