Function xpct::be_in

source ·
pub fn be_in<'a, Collection, Actual>(
    collection: Collection
) -> Matcher<'a, Actual, Actual>where
    Actual: Debug + 'a,
    Collection: Debug + Contains<Actual> + 'a,
Expand description

Succeeds when the actual value is contained in the expected collection.

You can use this matcher for your own types by implementing Contains on them.

Examples

use xpct::{be_in, expect};

expect!("Mañana").to(be_in(["Evrart", "Mañana"]));
expect!('C').to(be_in("Cuno"));
expect!(50).to(be_in(41..57));