Skip to content

Commit e22fd12

Browse files
committed
test: normalize TonePars generated paths
1 parent 16225ea commit e22fd12

1 file changed

Lines changed: 1 addition & 22 deletions

File tree

Src/Utilities/pcpatrflex/DisambiguateInFLExDB/DisambiguateInFLExDBTests/ToneParsInvokerTests.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -183,28 +183,7 @@ private void CompareResultToExpectedFile(string expectedFileString, string actua
183183

184184
private string NormalizeContent(string input)
185185
{
186-
string tp = "tonepars64";
187-
string normalized = NormalizeViaIndex(input, "AppData", "");
188-
normalized = NormalizeViaIndex(normalized, "TestData", "");
189-
normalized = NormalizeViaIndex(normalized, tp, tp);
190-
return normalized;
191-
}
192-
193-
private static string NormalizeViaIndex(string input, string match, string change)
194-
{
195-
// I tried to use regular expressions but never got them to match...
196-
int iAppData = input.IndexOf(match);
197-
if (iAppData != -1)
198-
{
199-
int iColon = input.IndexOf(":");
200-
if (iColon != -1)
201-
{
202-
iColon--; // skip the drive letter, too
203-
string appdataPath = input.Substring(iColon, iAppData - iColon);
204-
input = input.Replace(appdataPath, change);
205-
}
206-
}
207-
return input;
186+
return Regex.Replace(input, @"[A-Za-z]:\\(?:[^\\\r\n""]+\\)*", "");
208187
}
209188

210189
private void CreateExpectedFileStrings()

0 commit comments

Comments
 (0)