diff src/testdir/test_diffmode.vim @ 26815:421d082c8f09 v8.2.3936

patch 8.2.3936: no proper test for maintaining change mark in diff mode Commit: https://github.com/vim/vim/commit/ccc1644f95e7833c23fa0d440e42293c1622fdcb Author: Sean Dewar <seandewar@users.noreply.github.com> Date: Wed Dec 29 16:44:48 2021 +0000 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 #9424)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Dec 2021 17:45:02 +0100
parents 83a99f08d1e8
children 391eb1c30344
line wrap: on
line diff
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -1189,22 +1189,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
 
 " Test for 'patchexpr'