alamb commented on code in PR #9813:
URL: https://github.com/apache/arrow-rs/pull/9813#discussion_r3140956707
##########
arrow-data/src/data.rs:
##########
@@ -2372,6 +2375,19 @@ mod tests {
assert_eq!(data.null_count() - 1, new_data.null_count());
}
+ #[test]
Review Comment:
Here is how the test fails without the code change
It seems like maybe we should start running some targeted tests in release
builds too to really ensure these cases are covered 🤔
```
andrewlamb@Andrews-MacBook-Pro-3:~/Software/arrow-rs$ cargo test -p
arrow-data test_slice_panics_on_offset_length_overflow
Compiling arrow-data v58.1.0
(/Users/andrewlamb/Software/arrow-rs/arrow-data)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.45s
Running unittests src/lib.rs
(target/debug/deps/arrow_data-c6408ac97be22d82)
running 1 test
test data::tests::test_slice_panics_on_offset_length_overflow - should panic
... FAILED
failures:
---- data::tests::test_slice_panics_on_offset_length_overflow stdout ----
thread 'data::tests::test_slice_panics_on_offset_length_overflow' (46323764)
panicked at arrow-data/src/data.rs:581:17:
attempt to add with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: panic did not contain expected string
panic message: "attempt to add with overflow"
expected substring: "offset + length overflow"
failures:
data::tests::test_slice_panics_on_offset_length_overflow
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 27 filtered
out; finished in 0.00s
error: test failed, to rerun pass `-p arrow-data --lib`
```
--
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]