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:
Phil Scott
2021-03-06 09:57:31 -05:00
committed by Patrik Svensson
parent da9c6ee4c2
commit e4dda283bb
2 changed files with 36 additions and 2 deletions

View File

@ -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");
}
}
}