From d66600f7e2d4d22eda7a03001d6557682e8f21bc Mon Sep 17 00:00:00 2001 From: Lukasz Samson Date: Tue, 11 Jun 2024 07:18:12 +0200 Subject: [PATCH] fix tests on OTP < 27 --- .../test/markdown_utils_test.exs | 26 ++++++++++--------- .../providers/completion/suggestions_test.exs | 2 +- .../signature_help/signature_test.exs | 2 +- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/language_server/test/markdown_utils_test.exs b/apps/language_server/test/markdown_utils_test.exs index bc47aeea3..d6abd838d 100644 --- a/apps/language_server/test/markdown_utils_test.exs +++ b/apps/language_server/test/markdown_utils_test.exs @@ -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 diff --git a/apps/language_server/test/providers/completion/suggestions_test.exs b/apps/language_server/test/providers/completion/suggestions_test.exs index 31c9f52d4..4c0c6cae3 100644 --- a/apps/language_server/test/providers/completion/suggestions_test.exs +++ b/apps/language_server/test/providers/completion/suggestions_test.exs @@ -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 diff --git a/apps/language_server/test/providers/signature_help/signature_test.exs b/apps/language_server/test/providers/signature_help/signature_test.exs index 22f2669c9..42617666a 100644 --- a/apps/language_server/test/providers/signature_help/signature_test.exs +++ b/apps/language_server/test/providers/signature_help/signature_test.exs @@ -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