Skip to content

Commit 432174b

Browse files
Fix coverage tests on windows
1 parent 8948b09 commit 432174b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

compiler/test/dotty/tools/dotc/coverage/CoverageTests.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ class CoverageTests:
3333
checkCoverageIn(rootSrc.resolve("run"), true)
3434

3535
def checkCoverageIn(dir: Path, run: Boolean)(using TestGroup): Unit =
36-
/** Converts \ to / on windows, to make the tests pass without changing the serialization. */
36+
/** Converts \\ (escaped \) to / on windows, to make the tests pass without changing the serialization. */
3737
def fixWindowsPaths(lines: Buffer[String]): Buffer[String] =
3838
val separator = java.io.File.separatorChar
39-
if separator != '/' then
40-
lines.map(_.replace(separator, '/'))
39+
if separator == '\\' then
40+
val escapedSep = "\\\\"
41+
lines.map(_.replace(escapedSep, "/"))
4142
else
4243
lines
4344
end fixWindowsPaths

0 commit comments

Comments
 (0)