Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/ex_unit/lib/ex_unit/case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,19 @@ defmodule ExUnit.Case do

defp normalize_tags(tags) do
Enum.reduce(Enum.reverse(tags), %{}, fn
{key, value}, acc -> Map.put(acc, key, value)
tag, acc when is_atom(tag) -> Map.put(acc, tag, true)
tag, acc when is_list(tag) -> Enum.into(tag, acc)
{key, value}, acc ->
Map.put(acc, key, value)

tag, acc when is_atom(tag) ->
Map.put(acc, tag, true)

tag, acc ->
if Keyword.keyword?(tag) do
Enum.into(tag, acc)
else
raise "an invalid value for a tag was used. " <>
"Expected an atom or a keyword list, got: #{inspect(tag)}"
end
end)
end
end