patch 8.2.3108: test for remote_foreground() fails

Problem:    Test for remote_foreground() fails. (Elimar Riesebieter)
Solution:   Check that $DISPLAY is set. (Christian Brabandt)
diff --git a/src/testdir/check.vim b/src/testdir/check.vim
index d6bfe00..504a192 100644
--- a/src/testdir/check.vim
+++ b/src/testdir/check.vim
@@ -136,6 +136,14 @@
   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()