changeset 25925:8b34c216a523 v8.2.3496

patch 8.2.3496: crypt test fails if xxd was not installed yet Commit: https://github.com/vim/vim/commit/a5d4f3b09d25006f7bc988d618152bd34177a579 Author: James McCoy <jamessan@jamessan.com> Date: Mon Oct 11 16:27:03 2021 +0100 patch 8.2.3496: crypt test fails if xxd was not installed yet Problem: Crypt test fails on MS-Windows if xxd was not installed yet. Solution: Use the just built xxd executable if it exists. (James McCoy, closes #8929)
author Bram Moolenaar <Bram@vim.org>
date Mon, 11 Oct 2021 17:30:04 +0200
parents e65b6cacc437
children 76b0281bb759
files src/testdir/test_crypt.vim src/version.c
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_crypt.vim
+++ b/src/testdir/test_crypt.vim
@@ -3,6 +3,13 @@
 source check.vim
 CheckFeature cryptv
 
+let s:xxd_cmd = ''
+if empty($XXDPROG) && executable('..\xxd\xxd.exe')
+  let s:xxd_cmd = '..\xxd\xxd.exe'
+elseif !empty($XXDPROG) && executable($XXDPROG)
+  let s:xxd_cmd = $XXDPROG
+endif
+
 func Common_head_only(text)
   " This was crashing Vim
   split Xtest.txt
@@ -81,8 +88,11 @@ func Uncrypt_stable(method, crypted_text
 endfunc
 
 func Uncrypt_stable_xxd(method, hex, key, uncrypted_text)
+  if empty(s:xxd_cmd)
+    throw 'Skipped: xxd program missing'
+  endif
   " use xxd to write the binary content
-  call system('xxd -r >Xtest.txt', a:hex)
+  call system(s:xxd_cmd .. ' -r >Xtest.txt', a:hex)
   call feedkeys(":split Xtest.txt\<CR>" . a:key . "\<CR>", 'xt')
   call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
   bwipe!
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    3496,
+/**/
     3495,
 /**/
     3494,