On So, 04 Jul 2021, Bram Moolenaar wrote:
>
> Elimar Riesebieter wrote:
>
> > Environment:
> > amd64
> > tmux
> > clang-12
> >
> > Failures:
> > From test_vim9_builtin.vim:
> > Found errors in Test_remote_foreground():
> > command line..script /source/vim/vim-8.2.3104/src/vim-gtk3/testdir/runtest.vim[473]..function RunTheTest[44]..Test_remote_foreground line 5: Expected 'E241:' but got 'E240: No connection to the X server': remote_foreground("NonExistingServer")
>
> I can't think of a recent change that could have caused this.
> Perhaps it's a flaky test failure?
I suppose we need to have this change:
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index d6bfe004a..97ab6e5cf 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -209,6 +209,14 @@ func CheckNotAsan()
endif
endfunc
+" Command to Check for environment variable
+command -nargs=1 CheckEnv call CheckEnv(<f-args>)
+func CheckEnv(name)
+ if !exists('$' .. a:name)
+ throw 'Skipped: Environment variable ' .. a:name .. ' does not exists'
+ endif
+endfunc
+
" Command to check for satisfying any of the conditions.
" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim
index 38bd8271c..3a952ee79 100644
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -1416,6 +1416,7 @@ def Test_remote_foreground()
# remote_foreground() doesn't fail on MS-Windows
CheckNotMSWindows
CheckDefFailure(['remote_foreground(10)'], 'E1013: Argument 1: type mismatch, expected string but got number')
+ CheckEnv DISPLAY
assert_fails('remote_foreground("NonExistingServer")', 'E241:')
enddef
Best,
Christian
--
Elektrizität ist: Morgens mit Spannung aufstehen, mit Widerstand zur
Schule gehen, in allen Stunden gegen den Strom fließen, geladen nach
Hause kommen und dann noch vom Vater eine gewischt kriegen!