Mercurial > vim
diff src/testdir/test_popup.vim @ 13408:de69701e0592 v8.0.1578
patch 8.0.1578: no test for :popup in terminal
commit https://github.com/vim/vim/commit/69f5a3011d5a93e0d54837e97d625bd6c253d897
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 6 13:23:08 2018 +0100
patch 8.0.1578: no test for :popup in terminal
Problem: No test for :popup in terminal.
Solution: Add a screen dump test.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 06 Mar 2018 13:30:07 +0100 |
parents | 1ba4f926247c |
children | 66b1d74be322 |
line wrap: on
line diff
--- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -786,4 +786,33 @@ func Test_popup_position() call delete('Xtest') endfunc +func Test_popup_command() + if !CanRunVimInTerminal() || !has('menu') + return + endif + + call writefile([ + \ 'one two three four five', + \ 'and one two Xthree four five', + \ 'one more two three four five', + \ ], 'Xtest') + let buf = RunVimInTerminal('Xtest', {}) + call term_sendkeys(buf, ":source $VIMRUNTIME/menu.vim\<CR>") + call term_sendkeys(buf, "/X\<CR>:popup PopUp\<CR>") + call VerifyScreenDump(buf, 'Test_popup_command_01', {}) + + " Select a word + call term_sendkeys(buf, "jj") + call VerifyScreenDump(buf, 'Test_popup_command_02', {}) + + " Select a word + call term_sendkeys(buf, "j\<CR>") + call VerifyScreenDump(buf, 'Test_popup_command_03', {}) + + call term_sendkeys(buf, "\<Esc>") + call StopVimInTerminal(buf) + call delete('Xtest') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab