@@ -3937,36 +3937,38 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
39373937 assert suggestion . type_spec == "atom()"
39383938 end
39393939
3940- test "atom only options" do
3941- # only keyword in shorthand keyword list
3942- buffer = ":ets.new(:name, "
3943- assert list = suggestions_by_type ( :param_option , buffer )
3944- refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3945- assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3946-
3947- buffer = ":ets.new(:name, heir: pid, "
3948- assert list = suggestions_by_type ( :param_option , buffer )
3949- refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3950- assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3951-
3952- # suggest atom options in list
3953- buffer = ":ets.new(:name, ["
3954- assert list = suggestions_by_type ( :param_option , buffer )
3955- assert Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3956- assert Enum . any? ( list , & match? ( % { name: "set" } , & 1 ) )
3957- assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3958-
3959- buffer = ":ets.new(:name, [:set, "
3960- assert list = suggestions_by_type ( :param_option , buffer )
3961- assert Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3962- # refute Enum.any?(list, &match?(%{name: "set"}, &1))
3963- assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3964-
3965- # no atoms after keyword pair
3966- buffer = ":ets.new(:name, [:set, heir: pid, "
3967- assert list = suggestions_by_type ( :param_option , buffer )
3968- refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3969- assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3940+ if System . otp_release ( ) |> String . to_integer ( ) >= 25 do
3941+ test "atom only options" do
3942+ # only keyword in shorthand keyword list
3943+ buffer = ":ets.new(:name, "
3944+ assert list = suggestions_by_type ( :param_option , buffer )
3945+ refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3946+ assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3947+
3948+ buffer = ":ets.new(:name, heir: pid, "
3949+ assert list = suggestions_by_type ( :param_option , buffer )
3950+ refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3951+ assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3952+
3953+ # suggest atom options in list
3954+ buffer = ":ets.new(:name, ["
3955+ assert list = suggestions_by_type ( :param_option , buffer )
3956+ assert Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3957+ assert Enum . any? ( list , & match? ( % { name: "set" } , & 1 ) )
3958+ assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3959+
3960+ buffer = ":ets.new(:name, [:set, "
3961+ assert list = suggestions_by_type ( :param_option , buffer )
3962+ assert Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3963+ # refute Enum.any?(list, &match?(%{name: "set"}, &1))
3964+ assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3965+
3966+ # no atoms after keyword pair
3967+ buffer = ":ets.new(:name, [:set, heir: pid, "
3968+ assert list = suggestions_by_type ( :param_option , buffer )
3969+ refute Enum . any? ( list , & match? ( % { name: "bag" } , & 1 ) )
3970+ assert Enum . any? ( list , & match? ( % { name: "write_concurrency" } , & 1 ) )
3971+ end
39703972 end
39713973
39723974 test "format type spec" do
0 commit comments