galvanic_assert::matchers::collection

Function contained_in

Source
pub fn contained_in<'a, T, I>(
    expected_to_contain: I,
) -> Box<dyn Matcher<'a, T> + 'a>
where T: PartialEq + Debug + 'a, I: IntoIterator<Item = T>,
Expand description

Matches if the asserted (single) value is contained in the expected elements.

#Examples

use galvanic_assert::matchers::collection::*;
assert_that!(&5, contained_in(vec![1,2,3,4,5,6,7,8]));