Function galvanic_assert::matchers::collection::all_elements_satisfy [] [src]

pub fn all_elements_satisfy<'a, T, I, P>(
    predicate: P
) -> Box<Fn(&'a I) -> MatchResult> where
    T: Debug + 'a,
    &'a I: IntoIterator<Item = &'a T> + 'a,
    P: Fn(&'a T) -> bool + 'static, 

Matches if all elements in the asserted collection satisfy the given predicate.

An empty collection always satisfies this matcher as all (=no) element satisfies the predicate.

Examples

use galvanic_assert::matchers::collection::*;
assert_that!(&vec![1,2,3,4,5], all_elements_satisfy(|&a| 0 <= a && a < 100));