]> granicus.if.org Git - vim/commitdiff
patch 8.2.3108: test for remote_foreground() fails v8.2.3108
authorBram Moolenaar <Bram@vim.org>
Mon, 5 Jul 2021 12:10:04 +0000 (14:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 5 Jul 2021 12:10:04 +0000 (14:10 +0200)
Problem:    Test for remote_foreground() fails. (Elimar Riesebieter)
Solution:   Check that $DISPLAY is set. (Christian Brabandt)

src/testdir/check.vim
src/testdir/test_clientserver.vim
src/testdir/test_vim9_builtin.vim
src/version.c

index d6bfe004a62fe4063881bb49f55ddeeec854f191..504a1928ef081d0b62449d37e36a25303879f471 100644 (file)
@@ -136,6 +136,14 @@ func CheckCanRunGui()
   endif
 endfunc
 
+" Command to Check for an environment variable
+command -nargs=1 CheckEnv call CheckEnv(<f-args>)
+func CheckEnv(name)
+  if empty('$' .. a:name)
+    throw 'Skipped: Environment variable ' .. a:name .. ' is not set'
+  endif
+endfunc
+
 " Command to check that we are using the GUI
 command CheckGui call CheckGui()
 func CheckGui()
index 2704fb668d9eaff369a64f77b9b165b6d570a423..a088e178f7449a2e9d8df191166aa99428131585 100644 (file)
@@ -13,9 +13,7 @@ source shared.vim
 
 func Check_X11_Connection()
   if has('x11')
-    if empty($DISPLAY)
-      throw 'Skipped: $DISPLAY is not set'
-    endif
+    CheckEnv DISPLAY
     try
       call remote_send('xxx', '')
     catch
index 38bd8271c8eb0683267710e3fb5c9e685a8de640..f6b5a099b73d363e728b4c101ced167b69d1fc51 100644 (file)
@@ -1415,6 +1415,8 @@ def Test_remote_foreground()
   CheckFeature clientserver
   # remote_foreground() doesn't fail on MS-Windows
   CheckNotMSWindows
+  CheckEnv DISPLAY
+
   CheckDefFailure(['remote_foreground(10)'], 'E1013: Argument 1: type mismatch, expected string but got number')
   assert_fails('remote_foreground("NonExistingServer")', 'E241:')
 enddef
index 060c2e770d05582aaab8c318faf0db921eb242b0..9b1ac9aa59aeff1d7cd951a1727804c49e1b8d52 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3108,
 /**/
     3107,
 /**/