src/testdir/samples/*.vim \
src/testdir/samples/test000 \
src/testdir/samples/test.zip \
+ src/testdir/samples/test_undo.txt.undo \
src/testdir/samples/testa.zip \
src/testdir/color_ramp.vim \
src/testdir/silent.wav \
bwipe!
endfunc
+func Test_load_existing_undofile()
+ CheckFeature persistent_undo
+ sp samples/test_undo.txt
+ let mess=execute(':verbose rundo samples/test_undo.txt.undo')
+ call assert_match('Finished reading undo file', mess)
+
+ call assert_equal(['one', 'two', 'three'], getline(1, '$'))
+ norm! u
+ call assert_equal(['one', 'two'], getline(1, '$'))
+ norm! u
+ call assert_equal(['one'], getline(1, '$'))
+ norm! u
+ call assert_equal([''], getline(1, '$'))
+ let mess = execute(':norm! u')
+ call assert_equal([''], getline(1, '$'))
+ call assert_match('Already at oldest change', mess)
+ exe ":norm! \<c-r>"
+ call assert_equal(['one'], getline(1, '$'))
+ exe ":norm! \<c-r>"
+ call assert_equal(['one', 'two'], getline(1, '$'))
+ exe ":norm! \<c-r>"
+ call assert_equal(['one', 'two', 'three'], getline(1, '$'))
+ let mess = execute(":norm! \<c-r>")
+ call assert_equal(['one', 'two', 'three'], getline(1, '$'))
+ call assert_match('Already at newest change', mess)
+ bw!
+endfunc
+
+
" vim: shiftwidth=2 sts=2 expandtab