aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorjing <lhchenjw@gmail.com>2021-04-24 23:09:31 +0800
committerjing <lhchenjw@gmail.com>2021-05-06 23:44:47 +0800
commitf6518e55164be3fd2d10bf7738c5d76970fb8d79 (patch)
treec6e0c17250995dae14848b44c7ff17d395e25ea3 /test/functional/ui/float_spec.lua
parentbb7d3790bf08b5519623d261d8235bad77b5c0dd (diff)
downloadrneovim-f6518e55164be3fd2d10bf7738c5d76970fb8d79.tar.gz
rneovim-f6518e55164be3fd2d10bf7738c5d76970fb8d79.tar.bz2
rneovim-f6518e55164be3fd2d10bf7738c5d76970fb8d79.zip
vim-patch:8.1.1418: win_execute() is not implemented yet
Problem: Win_execute() is not implemented yet. Solution: Implement it. https://github.com/vim/vim/commit/868b7b6712ea4f2232eeeae18c5cbbbddf2ee84d
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index 3e73d8b3de..6b75803727 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -62,6 +62,24 @@ describe('float window', function()
eq(1000, funcs.win_getid())
end)
+ it('win_execute() should work' , function()
+ local buf = meths.create_buf(false, false)
+ meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'})
+ local win = meths.open_win(buf, false, {relative='win', width=16, height=1, row=0, col=10})
+ local line = funcs.win_execute(win, 'echo getline(1)')
+ eq('\nthe floatwin', line)
+ funcs.win_execute(win, 'bwipe!')
+ end)
+
+ it('win_execute() call commands that not allowed' , function()
+ local buf = meths.create_buf(false, false)
+ meths.buf_set_lines(buf, 0, -1, true, {'the floatwin'})
+ local win = meths.open_win(buf, true, {relative='win', width=16, height=1, row=0, col=10})
+ eq(pcall_err(funcs.win_execute, win, 'close'), 'Vim(close):E37: No write since last change (add ! to override)')
+ eq(pcall_err(funcs.win_execute, win, 'bdelete'), 'Vim(bdelete):E89: No write since last change for buffer 2 (add ! to override)')
+ funcs.win_execute(win, 'bwipe!')
+ end)
+
it('closed immediately by autocmd #11383', function()
eq('Error executing lua: [string "<nvim>"]:0: Window was closed immediately',
pcall_err(exec_lua, [[