2023-08-06 08:58:11 -06:00
|
|
|
defmodule Pleroma.Test.Matchers.List do
|
|
|
|
import ExUnit.Assertions
|
2023-08-06 09:20:46 -06:00
|
|
|
|
2023-08-06 08:58:11 -06:00
|
|
|
def assert_unordered_list_equal(list_a, list_b) when is_list(list_a) and is_list(list_b) do
|
2023-08-07 09:17:17 -06:00
|
|
|
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
|
2023-08-06 08:58:11 -06:00
|
|
|
end
|
|
|
|
end
|