Files
DodoSSH/tests/DodoSSH.Client.Terminal.Tests/RendererUnicodeTests.cs
T
jaap-jan 6806e542f9
ci / build and test (push) Successful in 3m37s
ci / android head (push) Successful in 3m45s
ci / api image (push) Successful in 8s
ci / desktop nightly (push) Successful in 1m44s
Terminal: measure characters with Unicode 11 widths, so an emoji takes the two columns the remote counts
2026-10-04 13:55:20 +02:00

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;
}
}