You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In updating one of my projects to nom 8, I noticed one of my tests started failing. I narrowed it down to the combination of nom::combinator::recognize and nom::character::complete::multispace0 being broken if multispace0 consumes the entire input.
In more detail, when adding the following test to src/combinator/tests.rs, cases A-C pass, but case D fails. This seems to have worked correctly in nom 7.
#[test]fnrecognize_issue(){usecrate::character::complete::{multispace0, multispace1};let input = "\na";// Case Aassert_eq!(
recognize::<_,crate::error::Error<_>, _>(multispace1).parse(input),Ok(("a","\n")));// Case Bassert_eq!(
recognize::<_,crate::error::Error<_>, _>(multispace0).parse(input),Ok(("a","\n")));let input = "\n";// Case Cassert_eq!(
recognize::<_,crate::error::Error<_>, _>(multispace1).parse(input),Ok(("","\n")));// Case Dassert_eq!(
recognize::<_,crate::error::Error<_>, _>(multispace0).parse(input),Ok(("","\n")));}
The text was updated successfully, but these errors were encountered:
In updating one of my projects to nom 8, I noticed one of my tests started failing. I narrowed it down to the combination of
nom::combinator::recognize
andnom::character::complete::multispace0
being broken ifmultispace0
consumes the entire input.In more detail, when adding the following test to
src/combinator/tests.rs
, cases A-C pass, but case D fails. This seems to have worked correctly in nom 7.The text was updated successfully, but these errors were encountered: