1
0
forked from aniani/vim

patch 7.4.2296

Problem:    No tests for :undolist and "U" command.
Solution:   Add tests. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2016-08-31 20:33:27 +02:00
parent 89bcfda683
commit c628fdcd46
2 changed files with 35 additions and 0 deletions

View File

@@ -129,6 +129,39 @@ func Test_undo_del_chars()
close!
endfunc
func Test_undolist()
new
set ul=100
let a=execute('undolist')
call assert_equal("\nNothing to undo", a)
" 1 leaf (2 changes).
call feedkeys('achange1', 'xt')
call feedkeys('achange2', 'xt')
let a=execute('undolist')
call assert_match("^\nnumber changes when *saved\n *2 *2 .*$", a)
" 2 leaves.
call feedkeys('u', 'xt')
call feedkeys('achange3\<Esc>', 'xt')
let a=execute('undolist')
call assert_match("^\nnumber changes when *saved\n *2 *2 *.*\n *3 *2 .*$", a)
close!
endfunc
func Test_U_command()
new
set ul=100
call feedkeys("achange1\<Esc>", 'xt')
call feedkeys("achange2\<Esc>", 'xt')
norm! U
call assert_equal('', getline(1))
norm! U
call assert_equal('change1change2', getline(1))
close!
endfunc
func Test_undojoin()
new
call feedkeys("Goaaaa\<Esc>", 'xt')

View File

@@ -763,6 +763,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2296,
/**/
2295,
/**/