mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
daignosing unit test fail in action
This commit is contained in:
@@ -625,7 +625,7 @@ internal class CursesDriver : ConsoleDriver {
|
||||
} catch (Exception e) {
|
||||
_window = null;
|
||||
_runningUnitTests = true;
|
||||
Debug.WriteLine ($"Curses failed to initialize. Assuming Unit Tests. The exception is: {e.Message}");
|
||||
throw new InvalidProgramException ($"Curses failed to initialize. Assuming Unit Tests. The exception is: {e.Message}");
|
||||
}
|
||||
|
||||
if (!_runningUnitTests) {
|
||||
|
||||
@@ -611,20 +611,22 @@ internal class NetDriver : ConsoleDriver {
|
||||
TerminalResized = terminalResized;
|
||||
|
||||
try {
|
||||
// In unit tests, this will throw
|
||||
Console.TreatControlCAsInput = true;
|
||||
|
||||
Cols = Console.WindowWidth;
|
||||
Rows = Console.WindowHeight;
|
||||
|
||||
//Enable alternative screen buffer.
|
||||
Console.Out.Write (EscSeqUtils.CSI_SaveCursorAndActivateAltBufferNoBackscroll);
|
||||
|
||||
//Set cursor key to application.
|
||||
Console.Out.Write (EscSeqUtils.CSI_HideCursor);
|
||||
|
||||
Console.TreatControlCAsInput = true;
|
||||
Cols = Console.WindowWidth;
|
||||
Rows = Console.WindowHeight;
|
||||
} catch (IOException) {
|
||||
// We are being run in an environment that does not support a console
|
||||
// such as a unit test, or a pipe.
|
||||
_runningUnitTests = true;
|
||||
throw new InvalidProgramException ();
|
||||
Cols = 80;
|
||||
Rows = 24;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user