fixes transcript writing

This commit is contained in:
ThatBen 2025-04-25 16:13:01 +02:00
parent dd888f30e3
commit 24a25292b8
No known key found for this signature in database
GPG Key ID: 62C543548433D43E
2 changed files with 5 additions and 3 deletions

View File

@ -4,8 +4,11 @@
{
public static string Between(string input, string open, string close)
{
var openIndex = input.IndexOf(open) + open.Length;
var openI = input.IndexOf(open);
if (openI == -1) return input;
var openIndex = openI + open.Length;
var closeIndex = input.LastIndexOf(close);
if (closeIndex == -1) return input;
return input.Substring(openIndex, closeIndex - openIndex);
}

View File

@ -37,7 +37,6 @@ namespace CodexTests
public void SetupCodexDistTest()
{
writer = SetupTranscript();
}
[TearDown]
@ -203,7 +202,7 @@ namespace CodexTests
Stopwatch.Measure(log, $"Transcript.FinalizeWriter", () =>
{
writer.IncludeFile(log.GetFullName());
writer.IncludeFile(log.GetFullName() + ".log");
writer.FinalizeWriter();
});
}