Escape markup in file paths for console output

Co-authored-by: StevanFreeborn <65925598+StevanFreeborn@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-09 23:44:31 +00:00
co-authored by StevanFreeborn
parent cfe0878bcd
commit f2fdc53222
2 changed files with 23 additions and 2 deletions
@@ -0,0 +1,21 @@
namespace StreamShorts.Console.Tests.Unit.Commands;
using Spectre.Console;
public class DefaultCommandTests
{
[Theory]
[InlineData("file[with]brackets.mp4", "file[[with]]brackets.mp4")]
[InlineData("normal-file.mp4", "normal-file.mp4")]
[InlineData("file_with_underscores.mp4", "file_with_underscores.mp4")]
[InlineData("file with spaces.mp4", "file with spaces.mp4")]
[InlineData("[brackets].mp4", "[[brackets]].mp4")]
public void EscapeMarkup_ShouldProperlyEscapeSquareBrackets(string input, string expected)
{
// Act
var result = input.EscapeMarkup();
// Assert
result.Should().Be(expected);
}
}