Skip to content

Commit f637bce

Browse files
committed
patch 8.2.2035: MS-Windows: some tests may fail
Problem: MS-Windows: some tests may fail. Solution: Avoid test failures. (Yegappan Lakshmanan, closes #7346)
1 parent 792f786 commit f637bce

4 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/testdir/test_channel.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,8 +2304,14 @@ endfunc
23042304
func Test_cb_with_input()
23052305
let g:wait_exit_cb = 1
23062306

2307-
call job_start('echo "Vim''s test"',
2308-
\ {'out_cb': 'ExitCb_cb_with_input'})
2307+
if has('win32')
2308+
let cmd = 'cmd /c echo "Vim''s test"'
2309+
else
2310+
let cmd = 'echo "Vim''s test"'
2311+
endif
2312+
2313+
let job = job_start(cmd, {'out_cb': 'ExitCb_cb_with_input'})
2314+
call WaitFor({-> job_status(job) == "dead"})
23092315
call WaitForAssert({-> assert_equal(0, g:wait_exit_cb)})
23102316

23112317
unlet g:wait_exit_cb

src/testdir/test_ex_mode.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func Test_ex_mode_with_global()
201201
call assert_equal(1, RunVim([], [], '-e -s -S Xexmodescript'))
202202
call assert_equal(['done'], readfile('Xdidexmode'))
203203

204+
call delete('logfile')
204205
call delete('Xdidexmode')
205206
call delete('Xexmodescript')
206207
endfunc

src/testdir/test_functions.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,16 @@ endfunc
12731273
func Test_executable_longname()
12741274
CheckMSWindows
12751275

1276-
let fname = 'X' . repeat('', 200) . '.bat'
1276+
" Create a temporary .bat file with 205 characters in the name.
1277+
" Maximum length of a filename (including the path) on MS-Windows is 259
1278+
" characters.
1279+
" See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
1280+
let len = 259 - getcwd()->len() - 6
1281+
if len > 200
1282+
let len = 200
1283+
endif
1284+
1285+
let fname = 'X' . repeat('', len) . '.bat'
12771286
call writefile([], fname)
12781287
call assert_equal(1, executable(fname))
12791288
call delete(fname)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2035,
753755
/**/
754756
2034,
755757
/**/

0 commit comments

Comments
 (0)