Function xpct::be_zero

source ·
pub fn be_zero<'a, T>() -> Matcher<'a, T, T, T::NonZero>where
    T: Debug + NonZeroInt + 'a,
Expand description

Succeeds when the actual integer value is 0.

When negated, this matcher converts the value to its non-zero counterpart (NonZeroU8, NonZeroI32, etc.). Otherwise, it behaves like equal(0).

Examples

use std::num::NonZeroU32;
use xpct::{expect, be_zero};

let result: NonZeroU32 = expect!(10u32)
    .to_not(be_zero())
    .into_inner();