summaryrefslogtreecommitdiff
path: root/src/testdir/test_popupwin.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_popupwin.vim')
-rw-r--r--src/testdir/test_popupwin.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 6607ea231..79eaca7c1 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1556,6 +1556,30 @@ func Test_popup_filter_normal_cmd()
call delete('XtestPopupNormal')
endfunc
+" this tests that we don't get stuck with an error in "win_execute()"
+func Test_popup_filter_win_execute()
+ CheckScreendump
+
+ let lines =<< trim END
+ let g:winid = popup_create('some text', {'filter': 'invalidfilter'})
+ call timer_start(0, {-> win_execute(g:winid, 'invalidCommand')})
+ END
+ call writefile(lines, 'XtestPopupWinExecute')
+ let buf = RunVimInTerminal('-S XtestPopupWinExecute', #{rows: 10, wait_for_ruler: 0})
+
+ call WaitFor({-> term_getline(buf, 9) =~ 'Not an editor command: invalidCommand'})
+ call term_sendkeys(buf, "\<CR>")
+ call WaitFor({-> term_getline(buf, 9) =~ 'Unknown function: invalidfilter'})
+ call term_sendkeys(buf, "\<CR>")
+ call WaitFor({-> term_getline(buf, 9) =~ 'Not allowed in a popup window'})
+ call term_sendkeys(buf, "\<CR>")
+ call term_sendkeys(buf, "\<CR>")
+ call VerifyScreenDump(buf, 'Test_popupwin_win_execute', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XtestPopupWinExecute')
+endfunc
+
func ShowDialog(key, result)
let s:cb_res = 999
let winid = popup_dialog('do you want to quit (Yes/no)?', #{