Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed May 29, 2024
1 parent cffa30d commit 6d7966f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arrow-array/src/builder/generic_bytes_view_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -378,6 +379,7 @@ mod tests {
"cup",
"cupcakes",
"😁",
"",
"Many strings are",
"This is a very long",
"are here contained of great",
Expand All @@ -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"
);
}
}

0 comments on commit 6d7966f

Please sign in to comment.