]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1733: tests: failure when remote_server() fails v9.1.1733
authorChristian Brabandt <cb@256bit.org>
Fri, 5 Sep 2025 15:21:51 +0000 (17:21 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 5 Sep 2025 15:25:58 +0000 (17:25 +0200)
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>
src/testdir/test_clientserver.vim
src/testdir/test_vim9_builtin.vim
src/testdir/test_wayland.vim
src/testdir/util/check.vim
src/version.c

index 4bda0caef7933edf37f91afa6650876f65116161..24d91409638f26406412e887ce77d5100f144209 100644 (file)
@@ -12,9 +12,7 @@ source util/shared.vim
 
 " Unlike X11, we need the socket server running if we want to send commands to
 " a server via sockets.
-if v:servername == ""
-  call remote_startserver('VIMSOCKETSERVERTEST')
-endif
+CheckSocketServer
 
 func Check_X11_Connection()
   if has('x11')
index aac831794f6305a0e22132c3c59caf55e8fc3242..8b84a47eca23140cdd6d159900e899b295909d19 100644 (file)
@@ -4,9 +4,7 @@ source util/screendump.vim
 import './util/vim9.vim' as v9
 
 " Socket backend for remote functions require the socket server to be running
-if v:servername == ""
-  call remote_startserver('VIMSOCKETSERVERTEST')
-endif
+CheckSocketServer
 
 " Test for passing too many or too few arguments to builtin functions
 func Test_internalfunc_arg_error()
index 3308b2a9363704a0b2b6881abe94cb97e8c02aa1..4b0fcd78caabbc4183535a6b25310dd5c2bc2d8b 100644 (file)
@@ -55,10 +55,9 @@ func s:CheckXConnection()
   CheckFeature x11
   try
     call remote_send('xxx', '')
+  catch /^Vim\%((\a\+)\)\=:E240:/ " not possible to start a remote server
+      throw 'Skipped: No connection to the X server possible'
   catch
-    if v:exception =~ 'E240:'
-      thrclientserverow 'Skipped: no connection to the X server'
-    endif
     " ignore other errors
   endtry
 endfunc
index aa8eceb620c63cf3f47ac46b9838bdee07b5b34e..f6bf8dfdb68b323b00538d1e23ca4ec8305abf40 100644 (file)
@@ -329,6 +329,17 @@ func CheckGithubActions()
   endif
 endfunc
 
+command CheckSocketServer call CheckSocketServer()
+func CheckSocketServer()
+  if v:servername == ""
+    try
+      call remote_startserver('VIMSOCKETSERVERTEST')
+    catch /^Vim\%((\a\+)\)\=:E240:/ " not possible to start a remote server
+      throw 'Skipped: Cannot start remote server'
+    endtry
+  endif
+endfunc
+
 let &cpo = s:cpo_save
 unlet s:cpo_save
 " vim: shiftwidth=2 sts=2 expandtab
index b28f72e8bb65d999593e6f1631a84b9834a1b08b..aea569a25537f0b66a0607ebdcd00da3435c2692 100644 (file)
@@ -724,6 +724,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1733,
 /**/
     1732,
 /**/