I am new to programming in R and have come across a baffling issue with testthat and Rscript.
I have a test file, call it test.R, that contains a bunch of testthat::test_that("test_name", {testthat::expect ...}) statements. If I run Rscript test.R, or if I just paste the statements from the test into the R console and manually check that the expect would pass, everything works as expected and my tests seem to succeed.
However, if I use library(devtools); devtools::test(), there is a failing test with a subscript out of bounds error.
I haven't included any specific code because I'm not looking to try to debug the particular error, but rather hope to understand how this is possible. Would testthat be running a different version? Is there differing behaviour between Rscript and the R console compared to what testthat would run under?
Aucun commentaire:
Enregistrer un commentaire