Skip to content

Commit d5edfc8

Browse files
committed
fix tests on windows
move provider tests to common dir
1 parent f4eeb88 commit d5edfc8

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

apps/language_server/test/language_server/providers/definition_test.exs renamed to apps/language_server/test/providers/definition_test.exs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ defmodule ElixirLS.LanguageServer.Providers.DefinitionTest do
33

44
alias ElixirLS.LanguageServer.Providers.Definition
55
alias ElixirLS.LanguageServer.Protocol.Location
6+
alias ElixirLS.LanguageServer.SourceFile
67
require ElixirLS.Test.TextLoc
78

89
test "find definition" do
9-
file_path = Path.join(__DIR__, "../../support/references_a.ex") |> Path.expand()
10+
file_path = Path.join(__DIR__, "../support/references_a.ex") |> Path.expand()
1011
text = File.read!(file_path)
11-
uri = "file://#{file_path}"
12+
uri = SourceFile.path_to_uri(file_path)
1213

13-
b_file_path = Path.join(__DIR__, "../../support/references_b.ex") |> Path.expand()
14-
b_uri = "file://#{b_file_path}"
14+
b_file_path = Path.join(__DIR__, "../support/references_b.ex") |> Path.expand()
15+
b_uri = SourceFile.path_to_uri(b_file_path)
1516

1617
{line, char} = {2, 30}
1718

apps/language_server/test/language_server/providers/references_test.exs renamed to apps/language_server/test/providers/references_test.exs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
22
use ExUnit.Case, async: true
33

44
alias ElixirLS.LanguageServer.Providers.References
5+
alias ElixirLS.LanguageServer.SourceFile
56
require ElixirLS.Test.TextLoc
67

78
test "finds references to a function" do
8-
file_path = Path.join(__DIR__, "../../support/references_b.ex") |> Path.expand()
9+
file_path = Path.join(__DIR__, "../support/references_b.ex") |> Path.expand()
910
text = File.read!(file_path)
10-
uri = "file://#{file_path}"
11+
uri = SourceFile.path_to_uri(file_path)
1112

1213
{line, char} = {2, 8}
1314

@@ -38,9 +39,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
3839
end
3940

4041
test "cannot find a references to a macro generated function call" do
41-
file_path = Path.join(__DIR__, "../../support/uses_macro_a.ex") |> Path.expand()
42+
file_path = Path.join(__DIR__, "../support/uses_macro_a.ex") |> Path.expand()
4243
text = File.read!(file_path)
43-
uri = "file://#{file_path}"
44+
uri = SourceFile.path_to_uri(file_path)
4445
{line, char} = {6, 13}
4546

4647
ElixirLS.Test.TextLoc.annotate_assert(file_path, line, char, """
@@ -52,9 +53,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
5253
end
5354

5455
test "finds a references to a macro imported function call" do
55-
file_path = Path.join(__DIR__, "../../support/uses_macro_a.ex") |> Path.expand()
56+
file_path = Path.join(__DIR__, "../support/uses_macro_a.ex") |> Path.expand()
5657
text = File.read!(file_path)
57-
uri = "file://#{file_path}"
58+
uri = SourceFile.path_to_uri(file_path)
5859
{line, char} = {10, 4}
5960

6061
ElixirLS.Test.TextLoc.annotate_assert(file_path, line, char, """
@@ -74,9 +75,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
7475
end
7576

7677
test "finds references to a variable" do
77-
file_path = Path.join(__DIR__, "../../support/references_b.ex") |> Path.expand()
78+
file_path = Path.join(__DIR__, "../support/references_b.ex") |> Path.expand()
7879
text = File.read!(file_path)
79-
uri = "file://#{file_path}"
80+
uri = SourceFile.path_to_uri(file_path)
8081
{line, char} = {4, 14}
8182

8283
ElixirLS.Test.TextLoc.annotate_assert(file_path, line, char, """

0 commit comments

Comments
 (0)