Function xpct::eq_casefold

source ·
pub fn eq_casefold<'a, Actual>(
    expected: impl Into<Cow<'a, str>>
) -> Matcher<'a, Actual, Actual>where
    Actual: Debug + AsRef<str> + 'a,
Available on crate feature casefold only.
Expand description

Succeeds when the actual string equals the expected string regardless of case.

This uses Unicode case folding as opposed to just str::to_lowercase.

Examples

use xpct::{expect, eq_casefold};

expect!("Fun").to(eq_casefold("fun"));
expect!("Spaß").to(eq_casefold("Spass"));