From 6d7966f0b2e2b23905c65bab9e4a4d98b45d884f Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Wed, 29 May 2024 13:58:56 +0100 Subject: [PATCH] More tests --- .../src/builder/generic_bytes_view_builder.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arrow-array/src/builder/generic_bytes_view_builder.rs b/arrow-array/src/builder/generic_bytes_view_builder.rs index 8f32a6795e1d..e7f13a68288a 100644 --- a/arrow-array/src/builder/generic_bytes_view_builder.rs +++ b/arrow-array/src/builder/generic_bytes_view_builder.rs @@ -355,6 +355,7 @@ mod tests { v.try_append_view(2, 0, 3).unwrap(); // cup v.try_append_view(2, 0, 8).unwrap(); // cupcakes v.try_append_view(0, 13, 4).unwrap(); // 😁 + v.try_append_view(0, 13, 0).unwrap(); // // Test longer strings v.try_append_view(3, 0, 16).unwrap(); // Many strings are @@ -378,6 +379,7 @@ mod tests { "cup", "cupcakes", "😁", + "", "Many strings are", "This is a very long", "are here contained of great", @@ -396,5 +398,17 @@ mod tests { let err = v.try_append_view(0, 13, 2).unwrap_err(); assert_eq!(err.to_string(), "Invalid argument error: Invalid view data"); + + let err = v.try_append_view(0, 40, 0).unwrap_err(); + assert_eq!( + err.to_string(), + "Invalid argument error: Range 40..40 out of bounds for block of length 17" + ); + + let err = v.try_append_view(5, 0, 0).unwrap_err(); + assert_eq!( + err.to_string(), + "Invalid argument error: No block found with index 5" + ); } }