patch 9.1.0893: No test that undofile format does not regress
Commit:
https://github.com/vim/vim/commit/14382c8bc96cc8f3985a01ab58c2f4d7b4d9ec85
Author: Christian Brabandt <
c...@256bit.org>
Date: Thu Nov 28 21:59:33 2024 +0100
patch 9.1.0893: No test that undofile format does not regress
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: #16127
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/Filelist b/Filelist
index c5b1b3910..caac66cdb 100644
--- a/Filelist
+++ b/Filelist
@@ -224,6 +224,7 @@ SRC_ALL = \
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 \
diff --git a/src/testdir/samples/test_undo.txt b/src/testdir/samples/test_undo.txt
new file mode 100644
index 000000000..4cb29ea38
--- /dev/null
+++ b/src/testdir/samples/test_undo.txt
@@ -0,0 +1,3 @@
+one
+two
+three
diff --git a/src/testdir/samples/test_undo.txt.undo b/src/testdir/samples/test_undo.txt.undo
new file mode 100644
index 0000000000000000000000000000000000000000..393af7f34f32c875724d871f0974b0a9b9ea8114
GIT binary patch
literal 1405
zcmWH`%$*;a=aT=Ffoa#&`5TvYc)h&J<n=e>qP6_G<H-lt9GidPVX9L=-sg*t7#J9s
zffxi}G$RrlBnHC_>F%BEEFf7%hWHCW3Iv!S6qtlaK?VK;0o+I=MWak=g#a)*SisT2
z!0=T9%}`KOFqk%iqX{`aLBgOY1Brp74jfHj)gY-+K>ZK^MiVP?G$98zm<^6RWKmee
pA?GcSyFeKcBsLmxpwOT>07e`ew73ID5pr}OA`V#;7;(>60RSD8H1q%f
literal 0
HcmV?d00001
diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim
index 2e598d35c..75ee4a5db 100644
--- a/src/testdir/test_undo.vim
+++ b/src/testdir/test_undo.vim
@@ -884,4 +884,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
diff --git a/src/version.c b/src/version.c
index d5a7899d7..8c4afd039 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 893,
/**/
892,
/**/