Machete.InAnyOrderMatcher (Machete v0.3.11)
View SourceDefines a matcher that matches lists in any order
Summary
Functions
Matches lists in any order. Matchers are applied in all possible orders until one matches; this can be exponentially expensive for long lists.
Types
Functions
@spec in_any_order([Machete.Matchable.t()]) :: t()
Matches lists in any order. Matchers are applied in all possible orders until one matches; this can be exponentially expensive for long lists.
Examples:
iex> assert [1] ~> in_any_order([1])
true
iex> assert [2, 1] ~> in_any_order([1, 2])
true
iex> assert [1, "a", :a] ~> in_any_order([string(), atom(), integer()])
true
iex> refute [1, 2] ~> in_any_order([1, 3])
false