mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-02 19:08:15 +08:00
Add support for indeterminate progress
This commit also changes the behavior of ProgressContext.IsFinished. Only tasks that have been started will be taken into consideration, and not indeterminate tasks. Closes #329 Closes #331
This commit is contained in:

committed by
Phil Scott

parent
6121203fee
commit
6f16081f42
@ -20,7 +20,7 @@ namespace Spectre.Console.Tests.Unit
|
||||
public string Render()
|
||||
{
|
||||
var console = new FakeConsole();
|
||||
var context = new RenderContext(console.Profile.Capabilities);
|
||||
var context = new RenderContext(console.Profile.ColorSystem, console.Profile.Capabilities);
|
||||
console.Write(Column.Render(context, Task, TimeSpan.Zero));
|
||||
return console.Output;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace Spectre.Console.Tests.Unit
|
||||
var text = new Text("Foo Bar Baz\nQux\nLol mobile");
|
||||
|
||||
// When
|
||||
var result = ((IRenderable)text).Measure(new RenderContext(caps), 80);
|
||||
var result = ((IRenderable)text).Measure(new RenderContext(ColorSystem.TrueColor, caps), 80);
|
||||
|
||||
// Then
|
||||
result.Min.ShouldBe(6);
|
||||
@ -29,7 +29,7 @@ namespace Spectre.Console.Tests.Unit
|
||||
var text = new Text("Foo Bar Baz\nQux\nLol mobile");
|
||||
|
||||
// When
|
||||
var result = ((IRenderable)text).Measure(new RenderContext(caps), 80);
|
||||
var result = ((IRenderable)text).Measure(new RenderContext(ColorSystem.TrueColor, caps), 80);
|
||||
|
||||
// Then
|
||||
result.Max.ShouldBe(11);
|
||||
|
Reference in New Issue
Block a user