mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-02 10:58:17 +08:00
Adds overloads for MarkUp methods without args
These methods don't require a string.format call so we'll directly call the Render method without a call to string.format. Added bonus of a a couple fewer allocations too.
This commit is contained in:

committed by
Patrik Svensson

parent
da9c6ee4c2
commit
e4dda283bb
@ -71,5 +71,19 @@ namespace Spectre.Console.Tests.Unit
|
||||
// Then
|
||||
console.Output.ShouldBe(output);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Should_not_fail_with_brackets_on_calls_without_args()
|
||||
{
|
||||
// Given
|
||||
var console = new FakeAnsiConsole(ColorSystem.Standard, AnsiSupport.Yes);
|
||||
|
||||
// When
|
||||
console.MarkupLine("{");
|
||||
|
||||
// Then
|
||||
console.Output.NormalizeLineEndings()
|
||||
.ShouldBe("{\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user