We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style = "deparse"
:
reprex:
f <- function() { 3:5 } test_that("test", { expect_snapshot_value(f(), style = "deparse") })
Saved the above in a test file in a package. Running the test with testthat::test_file() throws the following error:
testthat::test_file()
── Error (test-temp.R:6:3): test ─────────────────────────────────────────────── Error in `3:5`: could not find function ":" Backtrace: 1. testthat::expect_snapshot_value(f(), style = "deparse") at test-temp.R:6:2 2. testthat:::expect_snapshot_helper(...) 3. snapshotter$take_snapshot(...) 9. testthat (local) load(value_enc) 10. testthat:::reparse(x) 11. base::eval(parse(text = x), env) 12. base::eval(parse(text = x), env) [ FAIL 1 | WARN 0 | SKIP 0 | PASS 0 ]
This error seems similar in spirit to #1342 and #1294.
Session info:
R version 4.2.0 (2022-04-22) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Monterey 12.5.1 Matrix products: default LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] testthat_3.1.4 loaded via a namespace (and not attached): [1] compiler_4.2.0 magrittr_2.0.3 R6_2.5.1 rprojroot_2.0.3 cli_3.3.0 tools_4.2.0 withr_2.5.0 glue_1.6.2 [9] rstudioapi_0.13 waldo_0.4.0 crayon_1.5.1 desc_1.4.1 pkgload_1.3.0 brio_1.1.3 rlang_1.0.4
The text was updated successfully, but these errors were encountered:
This is important because it means that testthat can't expect_snapshot_value on style="deparse" when the value is a matrix that is nearly square.
expect_snapshot_value
style="deparse"
expect_snapshot_value(matrix(0, nrow=4,ncol=5), style="deparse") # Error in 4:5 : could not find function ":"
This comes up when an object has a matrix in it as well as another object in it that other styles cannot handle.
Sorry, something went wrong.
No branches or pull requests
reprex:
Saved the above in a test file in a package. Running the test with
testthat::test_file()
throws the following error:This error seems similar in spirit to #1342 and #1294.
Session info:
The text was updated successfully, but these errors were encountered: