Skip to content

Commit

Permalink
Merge pull request #1338 from nils-a/feature/GH-1188
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson authored Oct 19, 2023
2 parents e2a6748 + bbf58ee commit 63b940c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Spectre.Console/Widgets/Rows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ protected override Measurement Measure(RenderOptions options, int maxWidth)
if (measurements.Length > 0)
{
return new Measurement(
measurements.Min(c => c.Min),
measurements.Min(c => c.Max));
measurements.Max(c => c.Min),
measurements.Max(c => c.Max));
}

return new Measurement(0, 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
┌─────┐
│ 1 │
│ 22 │
│ 333 │
└─────┘
23 changes: 23 additions & 0 deletions test/Spectre.Console.Tests/Unit/Widgets/RowsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ namespace Spectre.Console.Tests.Unit;
[ExpectationPath("Widgets/Rows")]
public sealed class RowsTests
{
[Fact]
[Expectation("GH-1188-Rows")]
[GitHubIssue("https://github.com/spectreconsole/spectre.console/issues/1188")]
public Task Should_Render_Rows_In_Panel_Without_Breaking_Lines()
{
// Given
var console = new TestConsole().Width(60);
var rows = new Rows(
new IRenderable[]
{
new Text("1"),
new Text("22"),
new Text("333"),
});
var panel = new Panel(rows);

// When
console.Write(panel);

// Then
return Verifier.Verify(console.Output);
}

[Fact]
[Expectation("Render")]
public Task Should_Render_Rows()
Expand Down

0 comments on commit 63b940c

Please sign in to comment.