Quellcode durchsuchen

xclip does not work on headless linux (github actions)

Charlie Kindel vor 2 Jahren
Ursprung
Commit
9bde49d240
1 geänderte Dateien mit 10 neuen und 0 gelöschten Zeilen
  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;