Closed CGMossa closed 2 years ago
It would be nice if this was reviewed by someone who knows how this is supposed to work. I'll make any changes suggested, of course.
Well, these functions were intended to work with scalar input. Perhaps it is better to change how it is invoked when used with R 4.2?
Ok I checked the issue, I see that we use pretty_rel_path
to process multiple paths. Then it is OK to ensure we can work with a vectorized input. Could you please also add a test similar to the reprex discussed in the issue?
I think this is weird to make a test out of, but what do you think of this:
test_that("Running `document` after adding multiple files", {
skip_on_cran()
path <- local_package("testPackage")
rextendr::use_extendr()
rextendr::document()
file.create(glue("{path}src/rust/src/a.rs"))
file.create(glue("{path}src/rust/src/b.rs"))
rextendr::document()
})
Shouldn't we have an expect_*()
call for {testthat}
to work properly?
Yeah, but what should I expect? If an error happens then the test fails. The files are empty so there is no snapshot to be made and compared..
According to the {testthat}
docs (see the description of parameter regexp
), one can write exepct_error(code(), NA)
to signal that there should be no error.
This is due to
||
causing an error with more than 1 conditions in R 4.2.