1
0
forked from aniani/vim

patch 8.2.2608: character input not fully tested

Problem:    Character input not fully tested.
Solution:   Add more tests. (Yegappan Lakshmanan, closes #7963)
This commit is contained in:
Bram Moolenaar
2021-03-15 18:36:20 +01:00
parent 02b4d9b18a
commit f4fcedc59d
6 changed files with 59 additions and 0 deletions

View File

@@ -1430,6 +1430,14 @@ func Test_input_func()
delfunc Tcomplete
call assert_equal('item1 item2 item3', c)
" Test for using special characters as default input
call feedkeys(":let c = input('name? ', \"x\<BS>y\")\<CR>\<CR>", 'xt')
call assert_equal('y', c)
" Test for using <CR> as default input
call feedkeys(":let c = input('name? ', \"\\<CR>\")\<CR>x\<CR>", 'xt')
call assert_equal(' x', c)
call assert_fails("call input('F:', '', 'invalid')", 'E180:')
call assert_fails("call input('F:', '', [])", 'E730:')
endfunc