Describe the bug
Scrubbing of the current directory no longer works if the path is inside an ANSI sequence.
I have located the regression to first occur in Verify.NUnit 31.5.0 and onwards.
The scrubbing works if the path is not inside an ANSI sequence
Minimal Repro
[Test]
public Task Path_in_ansi_sequence_is_not_scrubbed() {
var currentDirectory = Directory.GetCurrentDirectory();
const string boldOn = "\u001b[1m";
const string reset = "\u001b[0m";
return Verify( $"Path: {boldOn}{currentDirectory}/myfile.yaml{reset}" );
}
Verify.NUnit 31.4.3:
Path: �[1m{CurrentDirectory}myfile.yaml�[0m
Verify.NUnit 31.5.0 (and later):
Path: �[1m/home/hojmark/git/drift/src/Cli.Tests/bin/Debug/net10.0/myfile.yaml�[0m