Skip to content

Commit 4daf031

Browse files
committed
patch 9.1.1733: tests: failure when remote_server() fails
Problem: tests: failure when remote_server() fails Solution: Catch E240 error when calling remote_server(), Fix syntax error in test_wayland.vim Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent f1212a7 commit 4daf031

5 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/testdir/test_clientserver.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ source util/shared.vim
1212

1313
" Unlike X11, we need the socket server running if we want to send commands to
1414
" a server via sockets.
15-
if v:servername == ""
16-
call remote_startserver('VIMSOCKETSERVERTEST')
17-
endif
15+
CheckSocketServer
1816

1917
func Check_X11_Connection()
2018
if has('x11')

src/testdir/test_vim9_builtin.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ source util/screendump.vim
44
import './util/vim9.vim' as v9
55

66
" Socket backend for remote functions require the socket server to be running
7-
if v:servername == ""
8-
call remote_startserver('VIMSOCKETSERVERTEST')
9-
endif
7+
CheckSocketServer
108

119
" Test for passing too many or too few arguments to builtin functions
1210
func Test_internalfunc_arg_error()

src/testdir/test_wayland.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ func s:CheckXConnection()
5555
CheckFeature x11
5656
try
5757
call remote_send('xxx', '')
58+
catch /^Vim\%((\a\+)\)\=:E240:/ " not possible to start a remote server
59+
throw 'Skipped: No connection to the X server possible'
5860
catch
59-
if v:exception =~ 'E240:'
60-
thrclientserverow 'Skipped: no connection to the X server'
61-
endif
6261
" ignore other errors
6362
endtry
6463
endfunc

src/testdir/util/check.vim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,17 @@ func CheckGithubActions()
329329
endif
330330
endfunc
331331

332+
command CheckSocketServer call CheckSocketServer()
333+
func CheckSocketServer()
334+
if v:servername == ""
335+
try
336+
call remote_startserver('VIMSOCKETSERVERTEST')
337+
catch /^Vim\%((\a\+)\)\=:E240:/ " not possible to start a remote server
338+
throw 'Skipped: Cannot start remote server'
339+
endtry
340+
endif
341+
endfunc
342+
332343
let &cpo = s:cpo_save
333344
unlet s:cpo_save
334345
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

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

725725
static int included_patches[] =
726726
{ /* Add new patch number below this line */
727+
/**/
728+
1733,
727729
/**/
728730
1732,
729731
/**/

0 commit comments

Comments
 (0)