Macro nom_test_helpers::assert_done_and_eq[][src]

macro_rules! assert_done_and_eq {
    ($e:expr, $a:expr $(,)?) => { ... };
    ($e:expr, $a:expr, $($arg:tt)+) => { ... };
}

This checks that the IResult is Done, and lets you check that the value returned as the O type of the IResult is equal to the second parameter

Examples

use nom_test_helpers::assert_done_and_eq;

let r: nom::IResult<&[u8], &[u8]> = Ok((b"abcd", b"efgh"));
assert_done_and_eq!(r, b"efgh");