From a94f625bc8fc668f27ce8a539ed4fca4f10dab02 Mon Sep 17 00:00:00 2001 From: Chris An Date: Sun, 25 Oct 2026 18:40:41 +0800 Subject: [PATCH] test(rio): cover maximum index varint totals (#8915) --- crates/rio/src/compress_index.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/rio/src/compress_index.rs b/crates/rio/src/compress_index.rs index de997054e..56a4dab63 100644 --- a/crates/rio/src/compress_index.rs +++ b/crates/rio/src/compress_index.rs @@ -728,7 +728,7 @@ mod tests { } #[test] - fn test_index_round_trip_with_negative_compressed_deltas_and_large_offsets() -> io::Result<()> { + fn test_index_round_trip_with_negative_compressed_deltas_and_maximum_totals() -> io::Result<()> { let mut source = Index::new(); source.est_block_uncomp = 1 << 20; // Compressed blocks much smaller than est_block_uncomp / 2 (512 KiB) @@ -737,8 +737,9 @@ mod tests { source.add(200, 1 << 20)?; source.add(300, 2 << 20)?; source.add(450, (3 << 20) + 12345)?; - source.total_uncompressed = 1i64 << 56; - source.total_compressed = 1i64 << 55; + // ZigZag + LEB128 needs all 10 bytes for the largest valid signed value. + source.total_uncompressed = i64::MAX; + source.total_compressed = i64::MAX; let encoded = source.clone().into_vec(); let mut decoded = Index::new();