pub fn consist_of<'a, T, Expected, Actual>(
elements: Expected
) -> Matcher<'a, Actual, Actual>where
T: 'a,
Expected: Debug + Contains<T> + Len + 'a,
Actual: Debug + IntoIterator + Len + Clone + 'a,
Actual::Item: Borrow<T>,
Expand description
Succeeds when the actual value contains exactly the given elements, in any order.
You can use this matcher for your own types by implementing Contains
and Len
on them.
use xpct::{expect, consist_of};
expect!(["foo", "bar", "baz"]).to(consist_of(["bar", "foo", "baz"]));