Skip to content

Commit

Permalink
add test when shifting by more than the number of bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Apr 28, 2023
1 parent 3caf1cc commit b7f4c6c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arrow-arith/src/bitwise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ mod tests {

#[test]
fn test_bitwise_shift_left() {
let left = UInt64Array::from(vec![Some(1), Some(2), None, Some(4)]);
let right = UInt64Array::from(vec![Some(5), Some(10), Some(8), Some(12)]);
let expected = UInt64Array::from(vec![Some(32), Some(2048), None, Some(16384)]);
let left = UInt64Array::from(vec![Some(1), Some(2), None, Some(4), Some(8)]);
let right =
UInt64Array::from(vec![Some(5), Some(10), Some(8), Some(12), Some(u64::MAX)]);
let expected =
UInt64Array::from(vec![Some(32), Some(2048), None, Some(16384), Some(0)]);
let result = bitwise_shift_left(&left, &right).unwrap();
assert_eq!(expected, result);
}
Expand Down

0 comments on commit b7f4c6c

Please sign in to comment.