From f4ab64fd6bcc7f045f52313dcba3f567013daa0f Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Mon, 25 Jan 2016 18:47:13 +0400 Subject: [PATCH] happy path test --- util/src/rlp/tests.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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