patch 9.1.2131: tests: Test_diff_screen() fails on BSD
Commit:
https://github.com/vim/vim/commit/991434d8dfe40770f3214e549df16ec3369316a9
Author: zeertzjq <[email protected]>
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
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,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vnwci-00E9eI-PC%40256bit.org.