Macro nom_test_helpers::assert_error_and_eq[][src]

macro_rules! assert_error_and_eq {
    ($r:expr, $err:expr $(,)?) => { ... };
    ($r:expr, $err:expr, $($arg:tt)+) => { ... };
}

This asserts that the IResult is an Err and that the error is what is expected

Examples

use nom_test_helpers::assert_error_and_eq;

let r: nom::IResult<&[u8], &[u8]> = Err(nom::Err::Error(nom::error::Error::new(&b""[..], nom::error::ErrorKind::Count)));
assert_error_and_eq!(r, nom::Err::Error(nom::error::Error::new(&b""[..], nom::error::ErrorKind::Count)));