]> granicus.if.org Git - vim/commitdiff
patch 8.2.2035: MS-Windows: some tests may fail v8.2.2035
authorBram Moolenaar <Bram@vim.org>
Mon, 23 Nov 2020 17:14:56 +0000 (18:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 23 Nov 2020 17:14:56 +0000 (18:14 +0100)
Problem:    MS-Windows: some tests may fail.
Solution:   Avoid test failures. (Yegappan Lakshmanan, closes #7346)

src/testdir/test_channel.vim
src/testdir/test_ex_mode.vim
src/testdir/test_functions.vim
src/version.c

index 90d828bdb3740af1a84904b22c482c2e99f7e561..e9cc258f04fc2012abe6c2927005c5ed86061e04 100644 (file)
@@ -2304,8 +2304,14 @@ endfunc
 func Test_cb_with_input()
   let g:wait_exit_cb = 1
 
-  call job_start('echo "Vim''s test"',
-        \ {'out_cb': 'ExitCb_cb_with_input'})
+  if has('win32')
+    let cmd = 'cmd /c echo "Vim''s test"'
+  else
+    let cmd = 'echo "Vim''s test"'
+  endif
+
+  let job = job_start(cmd, {'out_cb': 'ExitCb_cb_with_input'})
+  call WaitFor({-> job_status(job) == "dead"})
   call WaitForAssert({-> assert_equal(0, g:wait_exit_cb)})
 
   unlet g:wait_exit_cb
index 86687636fd6b00d80b699f9f3f2db2dbf724db02..3c6d08efb826ecf403304f900d2066924ad0fb91 100644 (file)
@@ -201,6 +201,7 @@ func Test_ex_mode_with_global()
   call assert_equal(1, RunVim([], [], '-e -s -S Xexmodescript'))
   call assert_equal(['done'], readfile('Xdidexmode'))
 
+  call delete('logfile')
   call delete('Xdidexmode')
   call delete('Xexmodescript')
 endfunc
index e8c372cd2ce3e1c2d4a8303fbf928b44f712c856..fb0b1936585c3fc15e3cf3257c4debe3e548a10f 100644 (file)
@@ -1273,7 +1273,16 @@ endfunc
 func Test_executable_longname()
   CheckMSWindows
 
-  let fname = 'X' . repeat('あ', 200) . '.bat'
+  " Create a temporary .bat file with 205 characters in the name.
+  " Maximum length of a filename (including the path) on MS-Windows is 259
+  " characters.
+  " See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
+  let len = 259 - getcwd()->len() - 6
+  if len > 200
+    let len = 200
+  endif
+
+  let fname = 'X' . repeat('あ', len) . '.bat'
   call writefile([], fname)
   call assert_equal(1, executable(fname))
   call delete(fname)
index a4ca493ca9534cb785c282fd75ffbfa1e344f7c0..ca81643090af0b35a87c8fe064b5141e5513cdd7 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2035,
 /**/
     2034,
 /**/