mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 18:40:50 +08:00 
			
		
		
		
	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:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							d306ad82d1
						
					
				
				
					commit
					7276e11ecc
				
			@@ -0,0 +1,8 @@
 | 
			
		||||
┌───────────────┬───────────────┬──────────────┐
 | 
			
		||||
│ Foo           │ Bar           │ Baz          │
 | 
			
		||||
├───────────────┼───────────────┼──────────────┤
 | 
			
		||||
│ 中文          │ 日本語        │ 한국어       │
 | 
			
		||||
│ 这是中文测试  │ これは日本語  │ 이것은한국어 │
 | 
			
		||||
│ 字符串        │ のテスト文字  │ 테스트문자열 │
 | 
			
		||||
│               │ 列です        │ 입니다       │
 | 
			
		||||
└───────────────┴───────────────┴──────────────┘
 | 
			
		||||
@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user