Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows OS detection in TraceNameManglingTest #21937

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class TraceNameManglingTest extends DottyTest {
}

@Test def escapeBackslashes(): Unit = {
val isWindows = sys.props("os.name").toLowerCase(Locale.ROOT) == "windows"
val filename = if isWindows then "/.scala" else "\\.scala"
val isWindows = sys.props("os.name").toLowerCase(Locale.ROOT).nn.contains("windows")
// 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
Loading