diff options
Diffstat (limited to 'vendor/nom/src/sequence/tests.rs')
-rw-r--r-- | vendor/nom/src/sequence/tests.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/vendor/nom/src/sequence/tests.rs b/vendor/nom/src/sequence/tests.rs index 201579be4..30ad0d678 100644 --- a/vendor/nom/src/sequence/tests.rs +++ b/vendor/nom/src/sequence/tests.rs @@ -1,6 +1,6 @@ use super::*; use crate::bytes::streaming::{tag, take}; -use crate::error::ErrorKind; +use crate::error::{Error, ErrorKind}; use crate::internal::{Err, IResult, Needed}; use crate::number::streaming::be_u16; @@ -272,3 +272,19 @@ fn tuple_test() { Err(Err::Error(error_position!(&b"jk"[..], ErrorKind::Tag))) ); } + +#[test] +fn unit_type() { + assert_eq!( + tuple::<&'static str, (), Error<&'static str>, ()>(())("abxsbsh"), + Ok(("abxsbsh", ())) + ); + assert_eq!( + tuple::<&'static str, (), Error<&'static str>, ()>(())("sdfjakdsas"), + Ok(("sdfjakdsas", ())) + ); + assert_eq!( + tuple::<&'static str, (), Error<&'static str>, ()>(())(""), + Ok(("", ())) + ); +} |