Public Access
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
namespace DodoSSH.Client.Terminal.Tests;
|
|
|
|
/// <summary>
|
|
/// The renderer page measures characters with Unicode 11's widths, so an emoji takes the two columns the
|
|
/// remote counts for it.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 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; <c>docs/manual-checks.md</c> 1.13 is where a person looks at the real one.
|
|
/// </remarks>
|
|
public sealed class RendererUnicodeTests
|
|
{
|
|
[Fact]
|
|
public void APane_LoadsTheUnicode11Addon()
|
|
{
|
|
var page = Opened();
|
|
|
|
page.HasUnicode11(7).ShouldBeTrue();
|
|
}
|
|
|
|
/// <remarks>
|
|
/// 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.
|
|
/// </remarks>
|
|
[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;
|
|
}
|
|
}
|