Skip to content

Commit b6949c5

Browse files
committed
add another test
1 parent cb4e5f7 commit b6949c5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/common/rlp/encode.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,19 @@ mod tests {
698698
assert_eq!(encoded.len(), value.length(),);
699699
}
700700

701+
#[test]
702+
fn u64_lengths_match_encoding_up_to_10k() {
703+
for n in 0u64..=10_000 {
704+
let mut encoded = Vec::new();
705+
n.encode(&mut encoded);
706+
assert_eq!(
707+
encoded.len(),
708+
n.length(),
709+
"u64 length mismatch at value {n}"
710+
);
711+
}
712+
}
713+
701714
#[test]
702715
fn can_encode_u8() {
703716
let mut encoded = Vec::new();

0 commit comments

Comments
 (0)