namespace DodoSSH.Client.Terminal.Tests;
///
/// The renderer page measures characters with Unicode 11's widths, so an emoji takes the two columns the
/// remote counts for it.
///
///
/// What is asserted is that the page asks for the table, and asks before the first frame. Whether xterm then
/// really draws 😀 across two cells is xterm's business, and the fake terminal in the harness is a stub with
/// a memory, not an emulator; docs/manual-checks.md 1.13 is where a person looks at the real one.
///
public sealed class RendererUnicodeTests
{
[Fact]
public void APane_LoadsTheUnicode11Addon()
{
var page = Opened();
page.HasUnicode11(7).ShouldBeTrue();
}
///
/// Before open() and not after it: a table chosen once the pane is open leaves whatever it drew first
/// measured with Unicode 6, which is the drift this exists to stop.
///
[Fact]
public void APane_IsOpenedWithUnicode11WidthsAlreadyActive()
{
var page = Opened();
page.UnicodeAtOpen(7).ShouldBe("11");
}
private static RendererPage Opened()
{
var page = RendererPage.Load();
page.Do("accept(0)");
page.Do("openSession(7)");
return page;
}
}