Permalink
Browse files

patch 7.4.2296

Problem:    No tests for :undolist and "U" command.
Solution:   Add tests. (Dominique Pelle)
  • Loading branch information...
1 parent 89bcfda commit c628fdcd46e93c308f742efdf54248695960e290 @brammool brammool committed Aug 31, 2016
Showing with 35 additions and 0 deletions.
  1. +33 −0 src/testdir/test_undo.vim
  2. +2 −0 src/version.c
@@ -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
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2296,
+/**/
2295,
/**/
2294,

0 comments on commit c628fdc

Please sign in to comment.