vim-patch:7.4.2296

Problem:    No tests for :undolist and "U" command.
Solution:   Add tests. (Dominique Pelle)

c628fdcd46
This commit is contained in:
lonerover 2017-03-22 08:34:04 +08:00
parent ab16c07584
commit c554b53040
2 changed files with 34 additions and 1 deletions

View File

@ -131,6 +131,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

@ -145,7 +145,7 @@ static int included_patches[] = {
2299,
// 2298 NA
// 2297 NA
// 2296,
2296,
2295,
2294,
2293,