comparison src/testdir/test_terminal3.vim @ 21524:8c6433359913 v8.2.1312

patch 8.2.1312: MS-Windows: terminal test may fail if dir.exe exists Commit: https://github.com/vim/vim/commit/066b12e36c32a87725303c0f71e968eb3f9a9f32 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 28 21:40:27 2020 +0200 patch 8.2.1312: MS-Windows: terminal test may fail if dir.exe exists Problem: MS-Windows: terminal test may fail if dir.exe exists. Solution: Use dir.com. (Ken Takata, closes https://github.com/vim/vim/issues/6557)
author Bram Moolenaar <Bram@vim.org>
date Tue, 28 Jul 2020 21:45:04 +0200
parents 299cf1c2a37d
children 08940efa6b4e
comparison
equal deleted inserted replaced
21523:dd0324c03303 21524:8c6433359913
41 term ++shell exec ls runtest.vim 41 term ++shell exec ls runtest.vim
42 call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))}) 42 call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))})
43 bwipe! 43 bwipe!
44 elseif has('win32') 44 elseif has('win32')
45 " dir is a shell builtin command, should fail without a shell. 45 " dir is a shell builtin command, should fail without a shell.
46 " However, if dir.exe (which might be provided by Cygwin/MSYS2) exists in
47 " the %PATH%, "term dir" succeeds unintentionally. Use dir.com instead.
46 try 48 try
47 term dir /b runtest.vim 49 term dir.com /b runtest.vim
48 call WaitForAssert({-> assert_match('job failed\|cannot access .*: No such file or directory', term_getline(bufnr(), 1))}) 50 call WaitForAssert({-> assert_match('job failed', term_getline(bufnr(), 1))})
49 catch /CreateProcess/ 51 catch /CreateProcess/
50 " ignore 52 " ignore
51 endtry 53 endtry
52 bwipe! 54 bwipe!
53 55
54 term ++shell dir /b runtest.vim 56 " This should execute the dir builtin command even with ".com".
57 term ++shell dir.com /b runtest.vim
55 call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))}) 58 call WaitForAssert({-> assert_match('runtest.vim', term_getline(bufnr(), 1))})
56 bwipe! 59 bwipe!
57 endif 60 endif
58 endfunc 61 endfunc
59 62