alamb commented on code in PR #2836:
URL: https://github.com/apache/arrow-rs/pull/2836#discussion_r993834201
##########
arrow-array/src/array/binary_array.rs:
##########
@@ -845,4 +852,22 @@ mod tests {
.validate_full()
.expect("All null array has valid array data");
}
+
+ #[test]
+ fn test_empty_offsets() {
+ let string = BinaryArray::from(
+ ArrayData::builder(DataType::Binary)
+ .buffers(vec![Buffer::from(&[]), Buffer::from(&[])])
+ .build()
+ .unwrap(),
+ );
+ assert_eq!(string.value_offsets(), &[0]);
+ let string = LargeBinaryArray::from(
Review Comment:
```suggestion
let string = LargeBinaryArray::from(
assert_eq!(string.len(), 0);
```
I suggest you add a test for `len()` as described in the original bug report.
This comment applies to all the tests added in this PR
--
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]