Commit: patch 9.1.2131: tests: Test_diff_screen() fails on BSD

0 views
Skip to first unread message

Christian Brabandt

unread,
Feb 5, 2026, 5:31:36 AM (12 days ago) Feb 5
to vim...@googlegroups.com
patch 9.1.2131: tests: Test_diff_screen() fails on BSD

Commit: https://github.com/vim/vim/commit/991434d8dfe40770f3214e549df16ec3369316a9
Author: zeertzjq <zeer...@outlook.com>
Date: Wed Feb 4 17:14:49 2026 +0000

patch 9.1.2131: tests: Test_diff_screen() fails on BSD

Problem: tests: Test_diff_screen() fails on BSD
Solution: Use gdiff on BSD systems if available (zeertzjq).

related: #19336

Signed-off-by: zeertzjq <zeer...@outlook.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/version9.txt b/runtime/doc/version9.txt
index 560c57358..52121472a 100644
--- a/runtime/doc/version9.txt
+++ b/runtime/doc/version9.txt
@@ -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
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index 5562f5edd..1a7840756 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -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()
diff --git a/src/version.c b/src/version.c
index 296bb7649..c42ad8c03 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2131,
/**/
2130,
/**/
Reply all
Reply to author
Forward
0 new messages