Skip to content

Commit 9074a99

Browse files
author
José Valim
committed
Add check for OTP 20
1 parent c7729df commit 9074a99

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/elixir/test/elixir/kernel/warning_test.exs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,17 @@ defmodule Kernel.WarningTest do
373373
purge Sample
374374
end
375375

376-
test "duplicate map keys" do
377-
assert capture_err(fn ->
378-
defmodule DuplicateKeys do
379-
assert %{a: :b, a: :c} == %{a: :c}
380-
assert %{1 => 2, 1 => 3} == %{1 => 3}
381-
assert %{:a => :b, a: :c} == %{a: :c}
382-
end
383-
end) =~ "key :a will be overridden in map"
376+
# TODO: Remove this check once we depend only on 19
377+
if :erlang.system_info(:otp_release) >= '20' do
378+
test "duplicate map keys" do
379+
assert capture_err(fn ->
380+
defmodule DuplicateKeys do
381+
assert %{a: :b, a: :c} == %{a: :c}
382+
assert %{1 => 2, 1 => 3} == %{1 => 3}
383+
assert %{:a => :b, a: :c} == %{a: :c}
384+
end
385+
end) =~ "key :a will be overridden in map"
386+
end
384387
end
385388

386389
test "unused guard" do

0 commit comments

Comments
 (0)