]> granicus.if.org Git - vim/commitdiff
patch 8.2.3496: crypt test fails if xxd was not installed yet v8.2.3496
authorJames McCoy <jamessan@jamessan.com>
Mon, 11 Oct 2021 15:27:03 +0000 (16:27 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 11 Oct 2021 15:27:03 +0000 (16:27 +0100)
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)

src/testdir/test_crypt.vim
src/version.c

index 2e34c80a1d877b2bc47682171c98150283692254..f43c22af0173495aae91ef0f72e3a9f571aa4fe7 100644 (file)
@@ -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, key, uncrypted_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!
index 2ef2946b48ec95cbd738b070a4392ce48b59868b..8a97806c6f63e4c09430e8b5fc8f6c8c1c04e7d4 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3496,
 /**/
     3495,
 /**/