diff --git a/src/debug.rs b/src/debug.rs index aa0c707..012e98c 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -157,6 +157,18 @@ mod tests { assert!(Any::from_der(&hex!("01 01 ff")).is_ok()); } + #[test] + fn debug_from_der_bool() { + eprintln!("** first test is ok**"); + assert!(::from_der(&hex!("01 01 ff")).is_ok()); + eprintln!("** second test fails when parsing ANY (eof)**"); + assert!(::from_der(&hex!("01 02 ff")).is_err()); + eprintln!("** second test fails when checking DER constraints**"); + assert!(::from_der(&hex!("01 01 f0")).is_err()); + eprintln!("** second test fails during TryFrom**"); + assert!(::from_der(&hex!("01 02 ff ff")).is_err()); + } + #[test] fn debug_from_der_failures() { use crate::Sequence; diff --git a/src/traits.rs b/src/traits.rs index c0666bc..87bc211 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -185,7 +185,7 @@ where fn from_der(bytes: &'a [u8]) -> ParseResult { trace_generic( core::any::type_name::(), - "Any::from_der", + "T::from_der", |bytes| { let (i, any) = trace(core::any::type_name::(), parse_der_any, bytes) .map_err(nom::Err::convert)?;