Skip to content

Commit

Permalink
fix tests on OTP < 27
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed Jun 11, 2024
1 parent 90dd561 commit d66600f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
26 changes: 14 additions & 12 deletions apps/language_server/test/markdown_utils_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,21 @@ defmodule ElixirLS.LanguageServer.MarkdownUtilsTest do
) == "[Up and running](http://example.com/foo.md)"
end

test "erlang extra page" do
assert MarkdownUtils.transform_ex_doc_links(
"[Up and running](e:erts_alloc.md)",
:erlang
) == "[Up and running](https://www.erlang.org/doc/apps/erts/erts_alloc.html)"
end
if System.otp_release() |> String.to_integer() >= 27 do
test "erlang extra page" do
assert MarkdownUtils.transform_ex_doc_links(
"[Up and running](e:erts_alloc.md)",
:erlang
) == "[Up and running](https://www.erlang.org/doc/apps/erts/erts_alloc.html)"
end

test "erlang extra page with app" do
assert MarkdownUtils.transform_ex_doc_links(
"[Up and running](e:system:expressions.md#term-comparisons)",
:lists
) ==
"[Up and running](https://www.erlang.org/doc/system/expressions.html#term-comparisons)"
test "erlang extra page with app" do
assert MarkdownUtils.transform_ex_doc_links(
"[Up and running](e:system:expressions.md#term-comparisons)",
:lists
) ==
"[Up and running](https://www.erlang.org/doc/system/expressions.html#term-comparisons)"
end
end

test "expression" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4243,7 +4243,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
if System.otp_release() |> String.to_integer() >= 27 do
assert "The time unit used" <> _ = summary
else
assert "Supported time unit representations:" <> _ = summary
assert summary =~ "Supported time unit representations:"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ defmodule ElixirLS.LanguageServer.Providers.SignatureHelp.SignatureTest do
if System.otp_release() |> String.to_integer() >= 27 do
assert "The time unit" <> _ = summary
else
assert "Supported time unit representations" <> _ = summary
assert summary =~ "Supported time unit representations"
end
end
end
Expand Down

0 comments on commit d66600f

Please sign in to comment.