Skip to content

Commit

Permalink
Use ArrayData equality
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Apr 9, 2024
1 parent acf8707 commit 6a2b9a0
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions arrow-select/src/take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1466,11 +1466,6 @@ mod tests {

assert_eq!(actual.len(), index.len());

let actual = actual
.as_any()
.downcast_ref::<GenericByteViewArray<T>>()
.unwrap();

let expected = {
// ["large payload over 12 bytes", null, "world", "large payload over 12 bytes", "lulu", null]
let mut builder = GenericByteViewBuilder::<T>::new();
Expand All @@ -1483,20 +1478,7 @@ mod tests {
builder.finish()
};

_assert_byte_view_equal(actual, &expected);
}

fn _assert_byte_view_equal<T>(
array1: &GenericByteViewArray<T>,
array2: &GenericByteViewArray<T>,
) where
T: ByteViewType,
T::Native: PartialEq,
{
assert_eq!(array1.len(), array2.len());
for (v1, v2) in array1.iter().zip(array2.iter()) {
assert_eq!(v1, v2);
}
assert_eq!(actual.as_ref(), &expected);
}

#[test]
Expand Down

0 comments on commit 6a2b9a0

Please sign in to comment.