Skip to content

Commit 1ff0c46

Browse files
committed
on CI windows drive letter is changed from C: to D: on Path.expand
1 parent 0790fd8 commit 1ff0c46

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

apps/language_server/test/source_file/path_test.exs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,19 @@ defmodule ElixirLS.LanguageServer.SourceFile.PathTest do
144144

145145
test "windows path" do
146146
if is_windows() do
147-
assert "file:///c%3A/win/path" == to_uri("c:/win/path")
148-
assert "file:///c%3A/win/path" == to_uri("C:/win/path")
149-
assert "file:///c%3A/win/path" == to_uri("c:/win/path/")
150-
assert "file:///c%3A/win/path" == to_uri("/c:/win/path")
147+
drive_letter = Path.expand("/") |> String.split(":") |> hd()
148+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("c:/win/path")
149+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("C:/win/path")
150+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("c:/win/path/")
151+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("/c:/win/path")
151152

152-
assert "file:///c%3A/win/path" == to_uri("c:\\win\\path")
153-
assert "file:///c%3A/win/path" == to_uri("c:\\win/path")
153+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("c:\\win\\path")
154+
assert "file:///#{drive_letter}%3A/win/path" == to_uri("c:\\win/path")
154155

155-
assert "file:///c%3A/test%20with%20%25/path" ==
156+
assert "file:///#{drive_letter}%3A/test%20with%20%25/path" ==
156157
to_uri("c:\\test with %\\path")
157158

158-
assert "file:///c%3A/test%20with%20%2525/c%23code" ==
159+
assert "file:///#{drive_letter}%3A/test%20with%20%2525/c%23code" ==
159160
to_uri("c:\\test with %25\\c#code")
160161
end
161162
end

0 commit comments

Comments
 (0)