mirror of
https://github.com/neovim/neovim.git
synced 2026-02-21 09:50:19 +10:00
vim-patch:9.1.0893: No test that undofile format does not regress (#37193)
Problem: No test that undofile format does not regress
Solution: include a sample undofile to make sure we are always able to
read it
This is so, that we don't unintentionally change the undofile format and
make sure we can load an undo file that has been created by an older
Vim.
closes: vim/vim#16127
14382c8bc9
Convert the undo file in samples/ using method from #13973.
Co-authored-by: Christian Brabandt <cb@256bit.org>
(cherry picked from commit 94f7302e66)
This commit is contained in:
committed by
github-actions[bot]
parent
46f569a890
commit
44eae48b75
3
test/old/testdir/samples/test_undo.txt
Normal file
3
test/old/testdir/samples/test_undo.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
one
|
||||
two
|
||||
three
|
||||
BIN
test/old/testdir/samples/test_undo.txt.undo
Normal file
BIN
test/old/testdir/samples/test_undo.txt.undo
Normal file
Binary file not shown.
@@ -883,4 +883,33 @@ func Test_undo_range_normal()
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user