Jefffrey commented on code in PR #8927:
URL: https://github.com/apache/arrow-rs/pull/8927#discussion_r2564970805
##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -1002,10 +1016,26 @@ mod tests {
);
let nulls = NullBuffer::new_null(3);
- let err = FixedSizeBinaryArray::try_new(2, buffer,
Some(nulls)).unwrap_err();
+ let err = FixedSizeBinaryArray::try_new(2, buffer.clone(),
Some(nulls)).unwrap_err();
assert_eq!(
err.to_string(),
"Invalid argument error: Incorrect length of null buffer for
FixedSizeBinaryArray, expected 5 got 3"
);
+
+ let zero_sized = FixedSizeBinaryArray::new(0, Buffer::default(), None);
+ assert_eq!(zero_sized.len(), 0);
+
+ let nulls = NullBuffer::new_null(3);
+ let zero_sized_with_nulls = FixedSizeBinaryArray::new(0,
Buffer::default(), Some(nulls));
+ assert_eq!(zero_sized_with_nulls.len(), 3);
+
+ let zero_sized_with_non_empty_buffer =
FixedSizeBinaryArray::try_new(0, buffer, None);
+ assert!(
+ matches!(
+ zero_sized_with_non_empty_buffer,
Review Comment:
Perhaps assert the contents of the string as is done above
(`err.to_string()`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]