akkoma/test/support/matchers/list.ex
2023-08-07 16:17:17 +01:00

16 lines
392 B
Elixir

defmodule Pleroma.Test.Matchers.List do
import ExUnit.Assertions
def assert_unordered_list_equal(list_a, list_b) when is_list(list_a) and is_list(list_b) do
list_a = Enum.sort(list_a)
list_b = Enum.sort(list_b)
if list_a != list_b do
flunk("Expected list
#{inspect(list_a)}
to have the same elements as
#{inspect(list_b)}
")
end
end
end