romainfrancois commented on a change in pull request #11369:
URL: https://github.com/apache/arrow/pull/11369#discussion_r725912573
##########
File path: r/tests/testthat/test-altrep.R
##########
@@ -227,3 +242,19 @@ test_that("columns of struct types may be altrep", {
expect_true(is_altrep(df$x))
expect_true(is_altrep(df$y))
})
+
+test_that("R checks for bounds", {
+ v_int <- Array$create(c(1, 2, 3))$as_vector()
+ v_dbl <- Array$create(c(1L, 2L, 3L))$as_vector()
+ v_str <- Array$create(c("un", "deux", "trois"))$as_vector()
+
+ expect_snapshot({
+ (expect_error(v_int[[5]]))
Review comment:
This is the pattern we currently use for snapshots with errors, see e.g.
https://github.com/tidyverse/dplyr/issues/6044
This could also be
```r
expect_snapshot(error = TRUE, {
v_int[[5]]
...
})
```
but this pattern better prints error (not relevant here) and also IIUC lets
us specify more precisely which code errors.
--
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]