Browse Source

xclip does not work on headless linux (github actions)

Charlie Kindel 2 years ago
parent
commit
9bde49d240
1 changed files with 10 additions and 0 deletions
  1. 10 0
      UnitTests/ClipboardTests.cs

+ 10 - 0
UnitTests/ClipboardTests.cs

@@ -93,6 +93,11 @@ namespace Terminal.Gui.ConsoleDrivers {
 		[Fact, AutoInitShutdown (useFakeClipboard: false)]
 		public void Contents_Copies_From_OS_Clipboard ()
 		{
+			if (!Clipboard.IsSupported) {
+				output.WriteLine ($"The Clipboard not supported on this platform.");
+				return;
+			}
+
 			var clipText = "The Contents_Copies_From_OS_Clipboard unit test pasted this to the OS clipboard.";
 			var failed = false;
 			var getClipText = "";
@@ -161,6 +166,11 @@ namespace Terminal.Gui.ConsoleDrivers {
 		[Fact, AutoInitShutdown (useFakeClipboard: false)]
 		public void Contents_Pastes_To_OS_Clipboard ()
 		{
+			if (!Clipboard.IsSupported) {
+				output.WriteLine ($"The Clipboard not supported on this platform.");
+				return;
+			}
+
 			var clipText = "The Contents_Pastes_To_OS_Clipboard unit test pasted this via Clipboard.Contents.";
 			var clipReadText = "";
 			var failed = false;