Add a test for rendering table with EA characters

Test rending a table with East Asia characters (Chinese, Japanese, Korean).

The verified text file may look weird, but it looks normal and correctly in Console (tested in Windows Terminal, Terminal.app in macOS Monterey)
This commit is contained in:
Liam Sho 2021-08-12 21:57:28 +08:00 committed by Patrik Svensson
parent d306ad82d1
commit 7276e11ecc
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,8 @@
┌───────────────┬───────────────┬──────────────┐
│ Foo │ Bar │ Baz │
├───────────────┼───────────────┼──────────────┤
│ 中文 │ 日本語 │ 한국어 │
│ 这是中文测试 │ これは日本語 │ 이것은한국어 │
│ 字符串 │ のテスト文字 │ 테스트문자열 │
│ │ 列です │ 입니다 │
└───────────────┴───────────────┴──────────────┘

View File

@ -150,6 +150,24 @@ namespace Spectre.Console.Tests.Unit
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_EA_Character")]
public Task Should_Render_Table_With_EA_Character_Correctly()
{
// Given
var console = new TestConsole().Width(48);
var table = new Table();
table.AddColumns("Foo", "Bar", "Baz");
table.AddRow("中文", "日本語", "한국어");
table.AddRow("这是中文测试字符串", "これは日本語のテスト文字列です", "이것은한국어테스트문자열입니다");
// When
console.Write(table);
// Then
return Verifier.Verify(console.Output);
}
[Fact]
[Expectation("Render_Footers")]
public Task Should_Render_Table_With_Footers_Correctly()