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

Edition-related functions should accept only existing editions (2 and 3) #1547

Open
ALanguillaume opened this issue Jan 10, 2022 · 1 comment · May be fixed by #1551
Open

Edition-related functions should accept only existing editions (2 and 3) #1547

ALanguillaume opened this issue Jan 10, 2022 · 1 comment · May be fixed by #1551

Comments

@ALanguillaume
Copy link

library(testthat)

# Default in random REPL
edition_get()
#> [1] 2

local_edition(7)
#> Setting deferred event(s) on global environment.
#>   * Will be run automatically when session ends
#>   * Execute (and clear) with `withr::deferred_run()`.
#>   * Clear (without executing) with `withr::deferred_clear()`.
edition_get()
#> [1] 2
local_edition(5.2)
edition_get()
#> [1] 5.2
local_edition(2)
edition_get()
#> [1] 2
local_edition(18)
edition_get()
#> [1] 18
local_edition(rnorm(1))
edition_get()
#> [1] -1.483738

Created on 2022-01-10 by the reprex package (v2.0.1)

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.1.2 (2021-11-01)
#>  os       Pop!_OS 21.10
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en_US:en
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       Europe/Amsterdam
#>  date     2022-01-10
#>  pandoc   2.14.0.3 @ /usr/lib/rstudio/bin/pandoc/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  backports     1.4.1   2021-12-13 [1] CRAN (R 4.1.2)
#>  cli           3.1.0   2021-10-27 [1] CRAN (R 4.1.2)
#>  crayon        1.4.2   2021-10-29 [1] CRAN (R 4.1.2)
#>  desc          1.4.0   2021-09-28 [1] CRAN (R 4.1.2)
#>  digest        0.6.29  2021-12-01 [1] RSPM (R 4.1.0)
#>  ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.1.2)
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.1.2)
#>  fansi         0.5.0   2021-05-25 [1] CRAN (R 4.1.2)
#>  fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.1.2)
#>  fs            1.5.2   2021-12-08 [1] CRAN (R 4.1.2)
#>  glue          1.6.0   2021-12-17 [1] CRAN (R 4.1.2)
#>  highr         0.9     2021-04-16 [1] CRAN (R 4.1.2)
#>  htmltools     0.5.2   2021-08-25 [1] CRAN (R 4.1.2)
#>  knitr         1.37    2021-12-16 [1] CRAN (R 4.1.2)
#>  lifecycle     1.0.1   2021-09-24 [1] CRAN (R 4.1.2)
#>  magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.1.2)
#>  pillar        1.6.4   2021-10-18 [1] CRAN (R 4.1.2)
#>  pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.1.2)
#>  pkgload       1.2.4   2021-11-30 [1] RSPM (R 4.1.0)
#>  purrr         0.3.4   2020-04-17 [1] CRAN (R 4.1.2)
#>  R.cache       0.15.0  2021-04-30 [1] RSPM (R 4.1.0)
#>  R.methodsS3   1.8.1   2020-08-26 [1] RSPM (R 4.1.0)
#>  R.oo          1.24.0  2020-08-26 [1] RSPM (R 4.1.0)
#>  R.utils       2.11.0  2021-09-26 [1] RSPM (R 4.1.0)
#>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.1.2)
#>  reprex        2.0.1   2021-08-05 [1] CRAN (R 4.1.2)
#>  rlang         0.4.12  2021-10-18 [1] CRAN (R 4.1.2)
#>  rmarkdown     2.11    2021-09-14 [1] CRAN (R 4.1.2)
#>  rprojroot     2.0.2   2020-11-15 [1] CRAN (R 4.1.2)
#>  rstudioapi    0.13    2020-11-12 [1] CRAN (R 4.1.2)
#>  sessioninfo   1.2.2   2021-12-06 [1] RSPM (R 4.1.0)
#>  stringi       1.7.6   2021-11-29 [1] RSPM (R 4.1.0)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.1.2)
#>  styler        1.6.2   2021-09-23 [1] RSPM (R 4.1.0)
#>  testthat    * 3.1.1   2021-12-03 [1] CRAN (R 4.1.2)
#>  tibble        3.1.6   2021-11-07 [1] CRAN (R 4.1.2)
#>  utf8          1.2.2   2021-07-24 [1] CRAN (R 4.1.2)
#>  vctrs         0.3.8   2021-04-29 [1] CRAN (R 4.1.2)
#>  withr         2.4.3   2021-11-30 [1] RSPM (R 4.1.0)
#>  xfun          0.29    2021-12-14 [1] CRAN (R 4.1.2)
#>  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.1.2)
#> 
#>  [1] /home/bob/R/x86_64-pc-linux-gnu-library/4.1
#>  [2] /opt/R/4.1.2/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
@ALanguillaume
Copy link
Author

I would be glad to work on a PR.

ALanguillaume added a commit to ALanguillaume/testthat that referenced this issue Jan 11, 2022
An error is thrown when trying to set an edition that does not exist.
Fixes r-lib#1547.
@ALanguillaume ALanguillaume linked a pull request Jan 11, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant