Skip to content

Commit

Permalink
Acknowledge that filename with backslash cannot be created on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Nov 13, 2024
1 parent d26d87f commit cf6018a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 /\ :
Expand All @@ -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")
)
)
}
Expand Down

0 comments on commit cf6018a

Please sign in to comment.