Skip to main content

assert_none

Function assert_none 

Source
pub fn assert_none<T: Debug>(collection: &[T], predicate: impl Fn(&T) -> bool)
Expand description

Assert that no elements in a collection satisfy a predicate.

§Panics

Panics if any element satisfies the predicate.

§Example

use ironbeam::testing::assert_none;

let data = vec![1, 3, 5, 7];
assert_none(&data, |x| x % 2 == 0);