= Nom Test Helpers

https://docs.rs/nom-test-helpers[Documentation]

== Usage

Put this in your Cargo.toml:

[source,toml]

[dev-dependencies]

nom-test-helpers = "6"

== Examples

The macros in this crate are mostly focused on asserting things about IResult values returned from a nom parser.

For example, here is how you would test that an IResult is Ok, with a specific value for it's output value:

[source,rust]

use nom::{named, tag}; use nomtesthelpers::{assertdoneandeq, assertfinishedandeq};

named!(abcd<&str, &str>, tag!("abcd"));

fn main() { let r = abcd("abcd"); assertdoneand_eq!(r, "abcd");

// Additionally, if you want to assert that the I value of the IResult is empty,
// you can use `assert_finished_and_eq!` instead:

assert_finished_and_eq!(r, "abcd");

}