mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
vim-patch:8.2.2608: character input not fully tested
Problem: Character input not fully tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes vim/vim#7963)
f4fcedc59d
Cherry-pick related changes from patches 8.2.{0433,0866}.
This commit is contained in:
@@ -114,9 +114,7 @@ endfunc
|
||||
|
||||
" Test more-prompt (see :help more-prompt).
|
||||
func Test_message_more()
|
||||
if !CanRunVimInTerminal()
|
||||
throw 'Skipped: cannot run vim in terminal'
|
||||
endif
|
||||
CheckRunVimInTerminal
|
||||
let buf = RunVimInTerminal('', {'rows': 6})
|
||||
call term_sendkeys(buf, ":call setline(1, range(1, 100))\n")
|
||||
|
||||
@@ -203,14 +201,22 @@ func Test_message_more()
|
||||
call term_sendkeys(buf, 'q')
|
||||
call WaitForAssert({-> assert_equal('100', term_getline(buf, 5))})
|
||||
|
||||
call term_sendkeys(buf, ":q!\n")
|
||||
" Execute a : command from the more prompt
|
||||
call term_sendkeys(buf, ":%p#\n")
|
||||
call term_wait(buf)
|
||||
call WaitForAssert({-> assert_equal('-- More --', term_getline(buf, 6))})
|
||||
call term_sendkeys(buf, ":")
|
||||
call term_wait(buf)
|
||||
call WaitForAssert({-> assert_equal(':', term_getline(buf, 6))})
|
||||
call term_sendkeys(buf, "echo 'Hello'\n")
|
||||
call term_wait(buf)
|
||||
call WaitForAssert({-> assert_equal('Hello ', term_getline(buf, 5))})
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
func Test_ask_yesno()
|
||||
if !CanRunVimInTerminal()
|
||||
throw 'Skipped: cannot run vim in terminal'
|
||||
endif
|
||||
CheckRunVimInTerminal
|
||||
let buf = RunVimInTerminal('', {'rows': 6})
|
||||
call term_sendkeys(buf, ":call setline(1, range(1, 2))\n")
|
||||
|
||||
@@ -233,7 +239,6 @@ func Test_ask_yesno()
|
||||
call WaitForAssert({-> assert_equal('y1', term_getline(buf, 1))})
|
||||
call WaitForAssert({-> assert_equal('y2', term_getline(buf, 2))})
|
||||
|
||||
call term_sendkeys(buf, ":q!\n")
|
||||
call StopVimInTerminal(buf)
|
||||
endfunc
|
||||
|
||||
|
@@ -684,6 +684,16 @@ func Test_insert_small_delete()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" Record in insert mode using CTRL-O
|
||||
func Test_record_in_insert_mode()
|
||||
new
|
||||
let @r = ''
|
||||
call setline(1, ['foo'])
|
||||
call feedkeys("i\<C-O>qrbaz\<C-O>q", 'xt')
|
||||
call assert_equal('baz', @r)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_record_in_select_mode()
|
||||
new
|
||||
call setline(1, 'text')
|
||||
|
@@ -735,6 +735,20 @@ func Test_undofile_cryptmethod_blowfish2()
|
||||
set undofile& undolevels& cryptmethod&
|
||||
endfunc
|
||||
|
||||
" Test for redoing with incrementing numbered registers
|
||||
func Test_redo_repeat_numbered_register()
|
||||
new
|
||||
for [i, v] in [[1, 'one'], [2, 'two'], [3, 'three'],
|
||||
\ [4, 'four'], [5, 'five'], [6, 'six'],
|
||||
\ [7, 'seven'], [8, 'eight'], [9, 'nine']]
|
||||
exe 'let @' .. i .. '="' .. v .. '\n"'
|
||||
endfor
|
||||
call feedkeys('"1p.........', 'xt')
|
||||
call assert_equal(['', 'one', 'two', 'three', 'four', 'five', 'six',
|
||||
\ 'seven', 'eight', 'nine', 'nine'], getline(1, '$'))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_undo_mark()
|
||||
new
|
||||
" The undo is applied to the only line.
|
||||
|
Reference in New Issue
Block a user