Skip to content
New issue

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

another style="deparse" problem #1342

Closed
r2evans opened this issue Mar 1, 2021 · 0 comments
Closed

another style="deparse" problem #1342

r2evans opened this issue Mar 1, 2021 · 0 comments

Comments

@r2evans
Copy link

r2evans commented Mar 1, 2021

Related to #1263, but not fixed by 39285f2 (or anything up through today):

library(testthat)
test_that("what are negative cylinders?", {
  local_edition(3)
  expect_snapshot_value(
      transform(mtcars, cyl=cyl-100),
    style = "deparse"
  )
})
testthat::test_file("test-negcyl.R")
# == Testing test-negcyl.R =======================================================
# [ FAIL 1 | WARN 1 | SKIP 0 | PASS 0 ]
# -- Error (test-negcyl.R:4:3): what are negative cylinders? ---------------------
# Error: could not find function "-"
# Backtrace:
#   1. testthat::expect_snapshot_value(...) test-negcyl.R:4:2
#   2. testthat:::expect_snapshot_helper(...)
#   3. snapshotter$take_snapshot(val, save = save, load = load, ...)
#   9. testthat:::load(save(value))
#  10. testthat:::reparse(x)
#  11. [ base::eval(...) ] with 1 more call
#  13. base::structure(...)
# -- Warning (test-negcyl.R:2:1): (code run outside of `test_that()`) ------------
# Snapshots reset after error/skip
# [ FAIL 1 | WARN 1 | SKIP 0 | PASS 0 ]
session info
devtools::session_info()
# - Session info ---------------------------------------------------------------
#  setting  value                       
#  version  R version 4.0.3 (2020-10-10)
#  os       Windows 10 x64              
#  system   x86_64, mingw32             
#  ui       RTerm                       
#  language (EN)                        
#  collate  English_United States.1252  
#  ctype    English_United States.1252  
#  tz       America/New_York            
#  date     2021-03-01                  
# - Packages -------------------------------------------------------------------
#  package     * version    date       lib source                         
#  assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.0)                 
#  backports     1.1.6      2020-04-05 [1] CRAN (R 4.0.0)                 
#  callr         3.5.1      2020-10-13 [1] CRAN (R 4.0.3)                 
#  cli           2.3.0      2021-01-31 [1] CRAN (R 4.0.3)                 
#  crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.0)                 
#  DBI           1.1.1      2021-01-15 [1] CRAN (R 4.0.3)                 
#  desc          1.2.0      2018-05-01 [1] CRAN (R 4.0.0)                 
#  devtools      2.3.0      2020-04-10 [1] CRAN (R 4.0.0)                 
#  digest        0.6.25     2020-02-23 [1] CRAN (R 4.0.0)                 
#  dplyr         1.0.3      2021-01-15 [1] CRAN (R 4.0.3)                 
#  ellipsis      0.3.0      2019-09-20 [1] CRAN (R 4.0.0)                 
#  evaluate      0.14       2019-05-28 [1] CRAN (R 4.0.0)                 
#  fs            1.4.1      2020-04-04 [1] CRAN (R 4.0.0)                 
#  generics      0.0.2      2018-11-29 [1] CRAN (R 4.0.0)                 
#  glue          1.4.0      2020-04-03 [1] CRAN (R 4.0.0)                 
#  htmltools     0.5.1.1    2021-01-22 [1] CRAN (R 4.0.3)                 
#  knitr         1.30       2020-09-22 [1] CRAN (R 4.0.3)                 
#  lifecycle     0.2.0      2020-03-06 [1] CRAN (R 4.0.0)                 
#  magrittr      2.0.1      2020-11-17 [1] CRAN (R 4.0.3)                 
#  memoise       1.1.0      2017-04-21 [1] CRAN (R 4.0.0)                 
#  pillar        1.4.4      2020-05-05 [1] CRAN (R 4.0.0)                 
#  pkgbuild      1.0.8      2020-05-07 [1] CRAN (R 4.0.0)                 
#  pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.0.0)                 
#  pkgload       1.0.2      2018-10-29 [1] CRAN (R 4.0.0)                 
#  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.0.0)                 
#  processx      3.4.5      2020-11-30 [1] CRAN (R 4.0.3)                 
#  ps            1.5.0      2020-12-05 [1] CRAN (R 4.0.3)                 
#  purrr         0.3.4      2020-04-17 [1] CRAN (R 4.0.0)                 
#  r2          * 0.9.11     2021-02-15 [1] local                          
#  R6            2.4.1      2019-11-12 [1] CRAN (R 4.0.0)                 
#  remotes       2.1.1      2020-02-15 [1] CRAN (R 4.0.0)                 
#  rlang         0.4.10     2020-12-30 [1] CRAN (R 4.0.3)                 
#  rmarkdown     2.4        2020-09-30 [1] CRAN (R 4.0.2)                 
#  rprojroot     1.3-2      2018-01-03 [1] CRAN (R 4.0.0)                 
#  rstudioapi    0.11       2020-02-07 [1] CRAN (R 4.0.0)                 
#  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.0)                 
#  testthat    * 3.0.2.9000 2021-03-01 [1] Github (r-lib/testthat@4793514)
#  tibble        3.0.5      2021-01-15 [1] CRAN (R 4.0.3)                 
#  tidyselect    1.1.0      2020-05-11 [1] CRAN (R 4.0.0)                 
#  usethis       1.6.1      2020-04-29 [1] CRAN (R 4.0.0)                 
#  vctrs         0.3.6      2020-12-17 [1] CRAN (R 4.0.3)                 
#  waldo         0.2.3      2020-11-09 [1] CRAN (R 4.0.3)                 
#  withr         2.4.1      2021-01-26 [1] CRAN (R 4.0.3)                 
#  xfun          0.20       2021-01-06 [1] CRAN (R 4.0.3)                 
# [1] C:/Users/r2/R/win-library/4.0
# [2] C:/R/R-4.0.3/library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant