diff src/testdir/test_diffmode.vim @ 24683:05c199ea8295 v8.2.2880

patch 8.2.2880: unified diff fails if actually used Commit: https://github.com/vim/vim/commit/ad5c178a191cf2cf37a27c2a789d7afda3879831 Author: glacambre <code@lacamb.re> Date: Mon May 24 14:20:53 2021 +0200 patch 8.2.2880: unified diff fails if actually used Problem: Unified diff fails if actually used. Solution: Invoke :diffupdate in the test. Fix the check for working external diff. (Ghjuvan Lacambre, Christian Brabandt, closes #8197)
author Bram Moolenaar <Bram@vim.org>
date Mon, 24 May 2021 14:30:03 +0200
parents f51ea1b6d512
children 13812db714fa
line wrap: on
line diff
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -796,6 +796,7 @@ func VerifyBoth(buf, dumpfile, extra)
 
   " also test unified diff
   call term_sendkeys(a:buf, ":call SetupUnified()\<CR>:")
+  call term_sendkeys(a:buf, ":redraw!\<CR>:")
   call VerifyScreenDump(a:buf, a:dumpfile, {}, 'unified')
   call term_sendkeys(a:buf, ":call StopUnified()\<CR>:")
 endfunc
@@ -817,10 +818,11 @@ func Test_diff_screen()
       func UnifiedDiffExpr()
         " Prepend some text to check diff type detection
         call writefile(['warning', '  message'], v:fname_out)
-        silent exe '!diff -u ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out
+        silent exe '!diff -U0 ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out
       endfunc
       func SetupUnified()
         set diffexpr=UnifiedDiffExpr()
+        diffupdate
       endfunc
       func StopUnified()
         set diffexpr=
@@ -1218,4 +1220,5 @@ func Test_diff_filler_cursorcolumn()
   call delete('Xtest_diff_cuc')
 endfunc
 
+
 " vim: shiftwidth=2 sts=2 expandtab