diff src/testdir/test_functions.vim @ 17484:f1fd0b0b335c v8.1.1740

patch 8.1.1740: exepath() doesn't work for "bin/cat" commit https://github.com/vim/vim/commit/d08b8c4c04db9433340df38d21f0e26878f28421 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jul 24 14:59:45 2019 +0200 patch 8.1.1740: exepath() doesn't work for "bin/cat" Problem: Exepath() doesn't work for "bin/cat". Solution: Check for any path separator. (Daniel Hahler, closes https://github.com/vim/vim/issues/4724, closes #4710)
author Bram Moolenaar <Bram@vim.org>
date Wed, 24 Jul 2019 15:00:06 +0200
parents b6de6181e5ab
children 0da9bc55c31a
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -990,6 +990,14 @@ func Test_Executable()
   elseif has('unix')
     call assert_equal(1, executable('cat'))
     call assert_equal(0, executable('nodogshere'))
+
+    " get "cat" path and remove the leading /
+    let catcmd = exepath('cat')[1:]
+    new
+    lcd /
+    call assert_equal(1, executable(catcmd))
+    call assert_equal('/' .. catcmd, exepath(catcmd))
+    bwipe
   endif
 endfunc