Skip to main content

items

Function items 

Source
pub fn items<I>(iter: I) -> Items<<I as IntoIterator>::Item>
where I: IntoIterator,
Expand description

Collects an iterator into an Items wrapper that implements Sequence.

use test_better_core::TestResult;
use test_better_matchers::{contains, eq, check, items};

fn main() -> TestResult {
    let doubled = (1..=3).map(|n| n * 2);
    check!(items(doubled)).satisfies(contains(eq(4)))?;
    Ok(())
}