Public Access
Terminal: measure characters with Unicode 11 widths, so an emoji takes the two columns the remote counts
This commit is contained in:
1 parent
ad1a129159
commit
6806e542f9
9 files changed
+136
-6
No files matched your search
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user