diff --git a/compiler/test/dotty/tools/dotc/profile/TraceNameManglingTest.scala b/compiler/test/dotty/tools/dotc/profile/TraceNameManglingTest.scala index b0a4e0e2140f..f1f570cc85d4 100644 --- a/compiler/test/dotty/tools/dotc/profile/TraceNameManglingTest.scala +++ b/compiler/test/dotty/tools/dotc/profile/TraceNameManglingTest.scala @@ -28,7 +28,8 @@ class TraceNameManglingTest extends DottyTest { @Test def escapeBackslashes(): Unit = { val isWindows = sys.props("os.name").toLowerCase(Locale.ROOT).nn.contains("windows") - val filename = if isWindows then "/.scala" else "\\.scala" + // It is not possible to create a file with backslash in name on Windows + val filename = if isWindows then "test.scala" else "\\.scala" checkTraceEvents( """ |class /\ : @@ -46,7 +47,8 @@ class TraceNameManglingTest extends DottyTest { raw"setter /\\_=" ).map(TraceEvent("typecheck", _)) ++ Set( - TraceEvent("file", if isWindows then "/.scala" else "\\\\.scala") + // See comment aboce for Windows limitations + TraceEvent("file", if isWindows then filename else "\\\\.scala") ) ) }