Files
Terminal.Gui/UnitTests/ConsoleDrivers/ConsoleScrolllingTests.cs
Tig 7af54f369d Robustness improvements in prep for implementing Virtual Terminal Sequences (#3094)
* Fixes #2616. Support combining sequences that don't normalize

* Decouples Application from ConsoleDriver in TestHelpers

* Updates driver tests to match new arch

* Start on making all driver tests test all drivers

* Improves handling if combining marks.

* Fix unit tests fails.

* Fix unit tests fails.

* Handling combining mask.

* Tying to fix this unit test that sometimes fail.

* Add support for combining mask on NetDriver.

* Enable CombiningMarks as List<Rune>.

* Prevents combining marks on invalid runes default and space.

* Formatting for CI tests.

* Fix non-normalized combining mark to add 1 to Col.

* Reformatting for retest the CI.

* Forces non-normalized CMs to be ignored.

* Initial experiment

* Created ANSiDriver. Updated UI Catalog command line handling

* Fixed ForceDriver logic

* Fixed ForceDriver logic

* Updating P/Invoke

* Force16 colors WIP

* Fixed 16 colo mode

* Updated unit tests

* UI catalog tweak

* Added chinese scenario from bdisp

* Disabled AnsiDriver unit tests for now.

* Code cleanup

* Initial commit (fork from v2_fixes_2610_WT_VTS)

* Code cleanup

* Removed nativemethods.txt

* Removed not needed native stuff

* Code cleanup

* Ensures command line handler doesn't eat exceptions

---------

Co-authored-by: BDisp <bd.bdisp@gmail.com>
2024-01-04 22:35:18 -07:00

42 lines
1.0 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
// Alias Console to MockConsole so we don't accidentally use Console
using Console = Terminal.Gui.FakeConsole;
namespace Terminal.Gui.DriverTests;
public class ConsoleScrollingTests {
readonly ITestOutputHelper output;
public ConsoleScrollingTests (ITestOutputHelper output)
{
ConsoleDriver.RunningUnitTests = true;
this.output = output;
}
[Theory]
[InlineData (typeof (FakeDriver))]
//[InlineData (typeof (NetDriver))]
//[InlineData (typeof (ANSIDriver))]
//[InlineData (typeof (WindowsDriver))]
//[InlineData (typeof (CursesDriver))]
public void Left_And_Top_Is_Always_Zero (Type driverType)
{
var driver = (FakeDriver)Activator.CreateInstance (driverType);
Application.Init (driver);
Assert.Equal (0, Console.WindowLeft);
Assert.Equal (0, Console.WindowTop);
driver.SetWindowPosition (5, 5);
Assert.Equal (0, Console.WindowLeft);
Assert.Equal (0, Console.WindowTop);
Application.Shutdown ();
}
}