aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
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 /src/nvim/testdir
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 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_execute_func.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_execute_func.vim b/src/nvim/testdir/test_execute_func.vim
index eb84a6739d..98e0ea4e09 100644
--- a/src/nvim/testdir/test_execute_func.vim
+++ b/src/nvim/testdir/test_execute_func.vim
@@ -82,3 +82,27 @@ func Test_execute_not_silent()
endfor
call assert_equal('xyz ', text2)
endfunc
+
+func Test_win_execute()
+ let thiswin = win_getid()
+ new
+ let otherwin = win_getid()
+ call setline(1, 'the new window')
+ call win_gotoid(thiswin)
+ let line = win_execute(otherwin, 'echo getline(1)')
+ call assert_match('the new window', line)
+
+ if has('textprop')
+ let popupwin = popup_create('the popup win', {'line': 2, 'col': 3})
+ redraw
+ let line = win_execute(popupwin, 'echo getline(1)')
+ call assert_match('the popup win', line)
+
+ call assert_fails('call win_execute(popupwin, "bwipe!")', 'E937:')
+
+ call popup_close(popupwin)
+ endif
+
+ call win_gotoid(otherwin)
+ bwipe!
+endfunc