]> granicus.if.org Git - vim/commitdiff
patch 8.2.1312: MS-Windows: terminal test may fail if dir.exe exists v8.2.1312
authorBram Moolenaar <Bram@vim.org>
Tue, 28 Jul 2020 19:40:27 +0000 (21:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 28 Jul 2020 19:40:27 +0000 (21:40 +0200)
Problem:    MS-Windows: terminal test may fail if dir.exe exists.
Solution:   Use dir.com. (Ken Takata, closes #6557)

src/testdir/test_terminal3.vim
src/version.c

index 76e8a105433850484fc03330d6dcae12f8ca24f8..3343dafd8617bb1a302a1abc6c0cdb7e87bcd2ec 100644 (file)
@@ -43,15 +43,18 @@ func Test_terminal_shell_option()
     bwipe!
   elseif has('win32')
     " dir is a shell builtin command, should fail without a shell.
+    " However, if dir.exe (which might be provided by Cygwin/MSYS2) exists in
+    " the %PATH%, "term dir" succeeds unintentionally.  Use dir.com instead.
     try
-      term dir /b runtest.vim
-      call WaitForAssert({-> assert_match('job failed\|cannot access .*: No such file or directory', term_getline(bufnr(), 1))})
+      term dir.com /b runtest.vim
+      call WaitForAssert({-> assert_match('job failed', term_getline(bufnr(), 1))})
     catch /CreateProcess/
       " ignore
     endtry
     bwipe!
 
-    term ++shell dir /b runtest.vim
+    " This should execute the dir builtin command even with ".com".
+    term ++shell dir.com /b runtest.vim
     call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))})
     bwipe!
   endif
index 93da0a8ab71ac6e249629693d2615a882e214a17..26bd7ac6518a8b3500686ed96790be5ebd8d8cf6 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1312,
 /**/
     1311,
 /**/