diff --git a/util/src/rlp/tests.rs b/util/src/rlp/tests.rs index 737e3ce28..d522fa80b 100644 --- a/util/src/rlp/tests.rs +++ b/util/src/rlp/tests.rs @@ -374,4 +374,18 @@ fn test_rlp_long_data_length_check() let as_val: Result = rlp.as_val(); assert_eq!(Err(DecoderError::RlpInconsistentLengthAndData), as_val); +} + +#[test] +fn test_the_exact_long_string() +{ + let mut data: Vec = vec![0xb8, 255]; + for _ in 0..255 { + data.push(b'c'); + } + + let rlp = UntrustedRlp::new(&data); + + let as_val: Result = rlp.as_val(); + assert!(as_val.is_ok()); } \ No newline at end of file