mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 02:25:28 +08:00 
			
		
		
		
	Render tables with zero-width columns (#1197)
Fixes https://github.com/spectreconsole/spectre.console/issues/361
This commit is contained in:
		@@ -0,0 +1,6 @@
 | 
			
		||||
┌──┬───┐
 | 
			
		||||
│  │   │
 | 
			
		||||
├──┼───┤
 | 
			
		||||
│  │ A │
 | 
			
		||||
│  │ B │
 | 
			
		||||
└──┴───┘
 | 
			
		||||
@@ -573,4 +573,22 @@ public sealed class TableTests
 | 
			
		||||
        // Then
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Fact]
 | 
			
		||||
    [Expectation("Render_Empty_Column")]
 | 
			
		||||
    public Task Should_Render_Empty_Column_Correctly()
 | 
			
		||||
    {
 | 
			
		||||
        // Given
 | 
			
		||||
        var console = new TestConsole().Width(30);
 | 
			
		||||
        var table = new Table();
 | 
			
		||||
        table.AddColumns(string.Empty, string.Empty);
 | 
			
		||||
        table.AddRow(string.Empty, "A");
 | 
			
		||||
        table.AddRow(string.Empty, "B");
 | 
			
		||||
 | 
			
		||||
        // When
 | 
			
		||||
        console.Write(table);
 | 
			
		||||
 | 
			
		||||
        // Then
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user