HaoYang670 commented on code in PR #1988:
URL: https://github.com/apache/arrow-rs/pull/1988#discussion_r912364436
##########
arrow/src/array/builder/fixed_size_list_builder.rs:
##########
@@ -230,22 +219,20 @@ mod tests {
}
#[test]
- fn test_fixed_size_binary_builder() {
- let mut builder = FixedSizeBinaryBuilder::new(15, 5);
-
- // [b"hello", null, "arrow"]
- builder.append_value(b"hello").unwrap();
- builder.append_null().unwrap();
- builder.append_value(b"arrow").unwrap();
- let fixed_size_binary_array: FixedSizeBinaryArray = builder.finish();
-
- assert_eq!(
- &DataType::FixedSizeBinary(5),
- fixed_size_binary_array.data_type()
- );
- assert_eq!(3, fixed_size_binary_array.len());
- assert_eq!(1, fixed_size_binary_array.null_count());
- assert_eq!(10, fixed_size_binary_array.value_offset(2));
- assert_eq!(5, fixed_size_binary_array.value_length());
+ #[should_panic(
+ expected = "Length of the child array (10) must be the multiple of the
value length (3) and the array length (3)."
+ )]
+ fn test_fixed_size_list_array_builder_fail() {
Review Comment:
Test the checking in `finish`
--
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]