vim-patch:8.0.1578: no test for :popup in terminal

Problem:    No test for :popup in terminal.
Solution:   Add a screen dump test.
69f5a3011d
This commit is contained in:
Jan Edmund Lazo 2021-06-04 22:18:24 -04:00
parent 60bf49ab1c
commit b959de3a5f
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -850,6 +850,34 @@ 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
func Test_popup_complete_backwards()
new
call setline(1, ['Post', 'Port', 'Po'])