romainfrancois commented on a change in pull request #11502:
URL: https://github.com/apache/arrow/pull/11502#discussion_r735351673



##########
File path: r/tests/testthat/test-dplyr-funcs-string.R
##########
@@ -547,21 +547,21 @@ test_that("errors and warnings in string splitting", {
   x <- Expression$field_ref("x")
   expect_error(
     nse_funcs$str_split(x, fixed("and", ignore_case = TRUE)),
-    "Case-insensitive string splitting not supported by Arrow"
+    "Case-insensitive string splitting not supported in Arrow"

Review comment:
       I think it would be better for that kind of things to use snapshot tests 
from testthat 3rd edition. We currently use this form (here with dplyr code): 
   
   ```r
   test_that("across() gives meaningful messages", {
      expect_snapshot({
        (expect_error(
          tibble(x = 1) %>%
            summarise(res = across(where(is.numeric), 42))
        ))
        (expect_error(across()))
        (expect_error(c_across()))
      })
   
    })
   ```
   
   It is a little painful with the `(expect_error(`, but we do have the benefit 
of actually checking for an error, print it in a way that can be easily 
reviewed. 
   




-- 
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]


Reply via email to