Skip to content

Commit b132237

Browse files
authored
Chore: Some small test fixes (#4713)
Signed-off-by: Connor Tsui <[email protected]>
1 parent 75b99c1 commit b132237

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

encodings/pco/src/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn test_compress_decompress() {
4747
}
4848

4949
#[test]
50-
fn test_compress_decompress_big() {
50+
fn test_compress_decompress_small() {
5151
let array = PrimitiveArray::from_option_iter([None, Some(1)]);
5252
let compressed = PcoArray::from_primitive(&array, 3, 0).unwrap();
5353
assert_eq!(compressed.scalar_at(0), Scalar::null_typed::<i32>());

vortex-array/src/arrays/bool/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ mod tests {
3232
use crate::ToCanonical;
3333

3434
#[test]
35-
fn test_slice_large() {
35+
fn test_slice_hundred_elements() {
3636
let arr = BoolArray::from_iter(std::iter::repeat_n(Some(true), 100));
3737
let sliced_arr = arr.slice(8..16).to_bool();
3838
assert_eq!(sliced_arr.len(), 8);

vortex-array/src/arrays/list/compute/is_constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ mod tests {
192192
(0..101).map(|i| (i * 2) as u32).collect(),
193193
false
194194
)]
195-
fn test_large_list_is_constant(
195+
fn test_list_is_constant_with_threshold(
196196
#[case] elements: Vec<i32>,
197197
#[case] offsets: Vec<u32>,
198198
#[case] expected: bool,

vortex-buffer/src/buffer.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,12 @@ mod test {
617617
fn slice_unaligned() {
618618
let buf = buffer![0i32, 1, 2, 3, 4].into_byte_buffer();
619619
// With a regular slice, this would panic. See [`slice_bad_alignment`].
620-
buf.slice_unaligned(1..2);
620+
let sliced = buf.slice_unaligned(1..2);
621+
// Verify the slice has the expected length (1 byte from index 1 to 2).
622+
assert_eq!(sliced.len(), 1);
623+
// The original buffer has i32 values [0, 1, 2, 3, 4].
624+
// In little-endian bytes, 0i32 = [0, 0, 0, 0], so byte at index 1 is 0.
625+
assert_eq!(sliced.as_slice(), &[0]);
621626
}
622627

623628
#[test]

0 commit comments

Comments
 (0)