diff --git a/src/StaticSettingsTests/VirtualizedRunHelperTests.cs b/src/StaticSettingsTests/VirtualizedRunHelperTests.cs index 21ed60c6e..e6176838c 100644 --- a/src/StaticSettingsTests/VirtualizedRunHelperTests.cs +++ b/src/StaticSettingsTests/VirtualizedRunHelperTests.cs @@ -109,7 +109,10 @@ public char AltDirectorySeparatorChar } } - public bool PathExists(string path) => exists(path); + public bool PathExists(string path) => + exists(path) || + exists(path.Replace('\\', '/')) || + exists(path.Replace('/', '\\')); // Make sure Path.Combine behaves as on Unix, even when executed on Windows public string CombinePaths(string path1, string path2) => diff --git a/src/Verify/VirtualizedRunHelper.cs b/src/Verify/VirtualizedRunHelper.cs index 3d8538021..7eee902cf 100644 --- a/src/Verify/VirtualizedRunHelper.cs +++ b/src/Verify/VirtualizedRunHelper.cs @@ -128,7 +128,7 @@ bool TryInitializeFromBuildTimePath(string? originalCodeBaseRoot, string buildTi var currentDir = Env.CurrentDirectory; do { - var testMappedPath = Env.CombinePaths(currentDir, buildTimePathRelative.Replace('\\', '/')); + var testMappedPath = Env.CombinePaths(currentDir, buildTimePathRelative); if (Env.PathExists(testMappedPath)) { baseRootAbsolute = buildTimePath[..^buildTimePathRelative.Length];