From e0660c9ea6bbcfb2de454d6b2a56a350541622d6 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Mon, 22 Jun 2026 14:56:43 -0400 Subject: [PATCH] test: cover signed integers and bool in BitReader::get_batch test `test_get_batch` only exercised the unsigned types (`u8`/`u16`/`u32`/`u64`). `BitReader::get_batch` is generic over the signed integer types and `bool` as well, each with its own `FromBitpacked` implementation, but none of those were covered by the test. Extend the test to also run the signed counterpart of each width and `bool` (at its only supported bit width of 1). This locks in coverage for those code paths, which is especially relevant given that `parquet` is not part of the MIRI CI workflow. Co-Authored-By: Claude Opus 4.8 (1M context) --- parquet/src/util/bit_util.rs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/parquet/src/util/bit_util.rs b/parquet/src/util/bit_util.rs index d0b13072dc4e..8599e1334294 100644 --- a/parquet/src/util/bit_util.rs +++ b/parquet/src/util/bit_util.rs @@ -1223,11 +1223,30 @@ mod tests { const SIZE: &[usize] = &[1, 31, 32, 33, 128, 129]; for s in SIZE { for i in 0..=64 { + // `get_batch` is generic over all of these types, so exercise the + // signed integer types and `bool` alongside the unsigned types rather + // than relying on the unsigned coverage alone. match i { - 0..=8 => test_get_batch_helper::(*s, i), - 9..=16 => test_get_batch_helper::(*s, i), - 17..=32 => test_get_batch_helper::(*s, i), - _ => test_get_batch_helper::(*s, i), + 0..=8 => { + test_get_batch_helper::(*s, i); + test_get_batch_helper::(*s, i); + } + 9..=16 => { + test_get_batch_helper::(*s, i); + test_get_batch_helper::(*s, i); + } + 17..=32 => { + test_get_batch_helper::(*s, i); + test_get_batch_helper::(*s, i); + } + _ => { + test_get_batch_helper::(*s, i); + test_get_batch_helper::(*s, i); + } + } + // `bool` only supports a bit width of 1. + if i == 1 { + test_get_batch_helper::(*s, i); } } }