]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2131: tests: Test_diff_screen() fails on BSD v9.1.2131
authorzeertzjq <zeertzjq@outlook.com>
Wed, 4 Feb 2026 17:14:49 +0000 (17:14 +0000)
committerChristian Brabandt <cb@256bit.org>
Wed, 4 Feb 2026 17:18:29 +0000 (17:18 +0000)
Problem:  tests: Test_diff_screen() fails on BSD
Solution: Use gdiff on BSD systems if available (zeertzjq).

related: #19336

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/version9.txt
src/testdir/test_diffmode.vim
src/version.c

index 560c573586ed549e8f75afdb23a3db4ad29fa2c8..52121472a0e23cc687ce5ee753f54cc5fb11d221 100644 (file)
@@ -52473,4 +52473,9 @@ Solution: Fix incorrect return value of pagescroll(). Also invert the
           return value of scroll_with_sms() to be less confusing and
           match comments (zeertzjq).
 
+Patch 9.1.2131
+
+Problem:  tests: Test_diff_screen() fails on BSD
+Solution: Use gdiff on BSD systems if available (zeertzjq).
+
  vim:tw=78:ts=8:noet:ft=help:norl:fdm=manual:nofoldenable
index 5562f5edd5646f5022fb86079519c4933c41f5cb..1a7840756531aa23e8b997fae678ec2d50959a08 100644 (file)
@@ -992,6 +992,9 @@ func VerifyInternal(buf, dumpfile, extra)
 endfunc
 
 func Test_diff_screen()
+  if has('bsd')
+    CheckExecutable gdiff
+  endif
   if has('osxdarwin') && system('diff --version') =~ '^Apple diff'
     throw 'Skipped: unified diff does not work properly on this macOS version'
   endif
@@ -1004,7 +1007,8 @@ func Test_diff_screen()
       func UnifiedDiffExpr()
         " Prepend some text to check diff type detection
         call writefile(['warning', '  message'], v:fname_out)
-        silent exe '!diff -U0 ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out
+        let diff = has('bsd') ? 'gdiff' : 'diff'
+        silent exe $'!{diff} -U0 {v:fname_in} {v:fname_new}>>{v:fname_out}'
       endfunc
       func SetupUnified()
         set diffexpr=UnifiedDiffExpr()
index 296bb764907e4995ff178a98f9c3d26a49bac9ed..c42ad8c0325bc958cd5278ca34cf7b0905ce28c8 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2131,
 /**/
     2130,
 /**/