akkoma/test/support/matchers/list.ex

17 lines
392 B
Elixir
Raw Normal View History

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