aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-12-29 16:57:40 +0000
committerzeertzjq <zeertzjq@outlook.com>2022-01-27 18:47:55 +0800
commitc0ff0cac8719a175a2cdd8244d12015aef854b51 (patch)
treefe0143d28c3735cf9270bc029233dc3bcee31498
parente8af051f1bfa0791a294ab3725dce1dca1cd8d6b (diff)
downloadrneovim-c0ff0cac8719a175a2cdd8244d12015aef854b51.tar.gz
rneovim-c0ff0cac8719a175a2cdd8244d12015aef854b51.tar.bz2
rneovim-c0ff0cac8719a175a2cdd8244d12015aef854b51.zip
vim-patch:8.2.3936: no proper test for maintaining change mark in diff mode
Problem: No proper test for maintaining change mark in diff mode. Solution: Run the test with internal and external diff. (Sean Dewar, closes vim/vim#9424) https://github.com/vim/vim/commit/ccc1644f95e7833c23fa0d440e42293c1622fdcb
-rw-r--r--src/nvim/testdir/test_diffmode.vim40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/nvim/testdir/test_diffmode.vim b/src/nvim/testdir/test_diffmode.vim
index fe928c0f65..9829b6b654 100644
--- a/src/nvim/testdir/test_diffmode.vim
+++ b/src/nvim/testdir/test_diffmode.vim
@@ -1147,22 +1147,30 @@ func Test_diff_followwrap()
endfunc
func Test_diff_maintains_change_mark()
- enew!
- call setline(1, ['a', 'b', 'c', 'd'])
- diffthis
- new
- call setline(1, ['a', 'b', 'c', 'e'])
- " Set '[ and '] marks
- 2,3yank
- call assert_equal([2, 3], [line("'["), line("']")])
- " Verify they aren't affected by the implicit diff
- diffthis
- call assert_equal([2, 3], [line("'["), line("']")])
- " Verify they aren't affected by an explicit diff
- diffupdate
- call assert_equal([2, 3], [line("'["), line("']")])
- bwipe!
- bwipe!
+ func DiffMaintainsChangeMark()
+ enew!
+ call setline(1, ['a', 'b', 'c', 'd'])
+ diffthis
+ new
+ call setline(1, ['a', 'b', 'c', 'e'])
+ " Set '[ and '] marks
+ 2,3yank
+ call assert_equal([2, 3], [line("'["), line("']")])
+ " Verify they aren't affected by the implicit diff
+ diffthis
+ call assert_equal([2, 3], [line("'["), line("']")])
+ " Verify they aren't affected by an explicit diff
+ diffupdate
+ call assert_equal([2, 3], [line("'["), line("']")])
+ bwipe!
+ bwipe!
+ endfunc
+
+ set diffopt-=internal
+ call DiffMaintainsChangeMark()
+ set diffopt+=internal
+ call DiffMaintainsChangeMark()
+ set diffopt&
endfunc
func Test_diff_rnu()