diff --git a/.github/workflows/cff-validator.yml b/.github/workflows/cff-validator.yml index 9b7b6fa..7339792 100644 --- a/.github/workflows/cff-validator.yml +++ b/.github/workflows/cff-validator.yml @@ -16,5 +16,5 @@ jobs: uses: actions/checkout@v4 - name: Validate CITATION.cff - uses: dieghernan/cff-validator@main + uses: dieghernan/cff-validator@v4 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 29bf0aa..daed27e 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -39,22 +39,6 @@ jobs: covr::to_cobertura(cov) shell: Rscript {0} - - name: Create Junit Report - if: always() - run: | - test_out <- path.expand(file.path(getwd(), "junit.xml")) - testthat::test_local(reporter = testthat::JunitReporter$new(test_out)) - shell: Rscript {0} - - - name: Upload test results to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 - with: - # Fail if error if not on PR, or if on PR and token is given - fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} - file: ./junit.xml - token: ${{ secrets.CODECOV_TOKEN }} - - name: Upload coverage report uses: codecov/codecov-action@v5 with: diff --git a/CITATION.cff b/CITATION.cff index 481a9af..3531f79 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "cffr" in publications use:' type: software license: GPL-3.0-or-later title: 'cffr: Generate Citation File Format (''cff'') Metadata for R Packages' -version: 1.1.1 +version: 1.1.1.9000 doi: 10.21105/joss.03900 identifiers: - type: doi @@ -98,7 +98,7 @@ references: institution: name: R Foundation for Statistical Computing address: Vienna, Austria - year: '2024' + year: '2025' version: '>= 4.0.0' - type: software title: cli @@ -110,7 +110,7 @@ references: - family-names: Csárdi given-names: Gábor email: csardi.gabor@gmail.com - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.cli version: '>= 2.0.0' - type: software @@ -128,7 +128,7 @@ references: - family-names: Hester given-names: Jim email: james.f.hester@gmail.com - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.desc version: '>= 1.3.0' - type: software @@ -142,7 +142,7 @@ references: given-names: Jeroen email: jeroenooms@gmail.com orcid: https://orcid.org/0000-0002-4035-0289 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.jsonlite version: '>= 1.7.2' - type: software @@ -161,7 +161,7 @@ references: given-names: Mathias - family-names: Poberezkin given-names: Evgeny - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.jsonvalidate version: '>= 1.1.0' - type: software @@ -198,7 +198,7 @@ references: given-names: Zhian N. - family-names: Gao given-names: Charlie - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.yaml version: '>= 2.2.1' - type: software @@ -216,7 +216,7 @@ references: given-names: Diego email: diego.hernangomezherrero@gmail.com orcid: https://orcid.org/0000-0001-8457-4658 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.bibtex version: '>= 0.5.0' - type: software @@ -230,7 +230,7 @@ references: given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.knitr - type: software title: lifecycle @@ -246,7 +246,7 @@ references: given-names: Hadley email: hadley@posit.co orcid: https://orcid.org/0000-0003-4757-117X - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.lifecycle - type: software title: rmarkdown @@ -290,7 +290,7 @@ references: given-names: Richard email: rich@posit.co orcid: https://orcid.org/0000-0003-3925-190X - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.rmarkdown - type: software title: testthat @@ -302,7 +302,7 @@ references: - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.testthat version: '>= 3.0.0' - type: software @@ -328,6 +328,6 @@ references: given-names: Andy email: andy.teucher@posit.co orcid: https://orcid.org/0000-0002-7840-692X - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.usethis diff --git a/DESCRIPTION b/DESCRIPTION index ebac8c3..a3806f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: cffr Title: Generate Citation File Format ('cff') Metadata for R Packages -Version: 1.1.1 +Version: 1.1.1.9000 Authors@R: c( person("Diego", "Hernangómez", , "diego.hernangomezherrero@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658")), diff --git a/NEWS.md b/NEWS.md index ecd1d36..4c68c74 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# cffr (development version) + +- New parameter `r_citation` in `cff_write()`. When it is set to `TRUE` a + **R** citation file (`inst/CITATION`) would be generated/updated with the + information of the generated `CITATION.cff` file. **No backup copy would be + created**, for more control use `cff_write_citation()` (#79). + # cffr 1.1.1 - Adapt extraction of orcid to **R \> 4.4.1**. diff --git a/R/cff_write.R b/R/cff_write.R index af30389..59a7197 100644 --- a/R/cff_write.R +++ b/R/cff_write.R @@ -15,6 +15,11 @@ #' #' @param outfile The name and path of the `CITATION.cff` to be created. #' +#' @param r_citation Logical `TRUE/FALSE`. On `TRUE` the **R** package citation +#' (i.e. `inst/CITATION`) would be created or updated. +#' **No backup copy would be created**, for more control use +#' [cff_write_citation()]. +#' #' @param verbose Logical `TRUE/FALSE`. On `TRUE` the function would display #' informative messages. #' @@ -65,9 +70,9 @@ #' cff_write <- function(x, outfile = "CITATION.cff", keys = list(), cff_version = "1.2.0", gh_keywords = TRUE, - dependencies = TRUE, validate = TRUE, - verbose = TRUE, authors_roles = c("aut", "cre"), - encoding = "UTF-8") { + r_citation = FALSE, dependencies = TRUE, + validate = TRUE, verbose = TRUE, + authors_roles = c("aut", "cre"), encoding = "UTF-8") { # # On missing use NULL if (missing(x)) x <- getwd() @@ -136,5 +141,30 @@ cff_write <- function(x, outfile = "CITATION.cff", keys = list(), cff_validate(outfile, verbose) } + # Issue #79 + auto_r_citation( + r_citation = r_citation, + outfile = outfile, verbose = verbose + ) + return(invisible(citat)) } + + +auto_r_citation <- function(r_citation = TRUE, + outfile = "CITATION.cff", verbose = TRUE) { + # Do nothing + if (isFALSE(r_citation)) { + return(invisible(NULL)) + } + + # Else + if (verbose) { + cli::cat_rule("Updating inst/CITATION file", col = "cyan", line = 2) + } + cffobj <- cff_read(outfile) + fpath <- "./inst/CITATION" + if (file.exists(fpath)) unlink(fpath) + + cff_write_citation(cffobj, file = fpath, verbose = verbose) +} diff --git a/R/utils-alerts.R b/R/utils-alerts.R index 6024e95..feceaf0 100644 --- a/R/utils-alerts.R +++ b/R/utils-alerts.R @@ -78,7 +78,7 @@ write_lines_msg <- function(lines, file, verbose, append) { fh <- file(file, encoding = "UTF-8", open = ifelse(append, "a+", "w+")) on.exit(if (isOpen(fh)) close(fh)) if (verbose) { - cli::cli_alert_info("Writing {length(lines)} entr{?y/ies} ...") + cli::cli_alert_info("Writing {length(lines[lines != ''])} entr{?y/ies} ...") } writeLines(lines, fh) diff --git a/README.md b/README.md index 51e00f6..ae5822d 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ file and the `CITATION` file (if present) of your package. Note that **cffr** works best if your package pass `R CMD check/devtools::check()`. -As per 2024-12-30 there are at least 410 repos on GitHub using **cffr**. +As per 2025-01-18 there are at least 380 repos on GitHub using **cffr**. [Check them out here](https://github.com/search?q=cffr%20path%3A**%2FCITATION.cff&type=code). @@ -283,7 +283,7 @@ test <- cff_create("rmarkdown") institution: name: R Foundation for Statistical Computing address: Vienna, Austria - year: '2024' + year: '2025' version: '>= 3.0' - type: software title: bslib @@ -303,7 +303,7 @@ test <- cff_create("rmarkdown") given-names: Garrick email: garrick@posit.co orcid: https://orcid.org/0000-0002-7111-0077 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.bslib version: '>= 0.2.5.1' - type: software @@ -320,7 +320,7 @@ test <- cff_create("rmarkdown") - family-names: Xie given-names: Yihui orcid: https://orcid.org/0000-0003-0645-5666 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.evaluate version: '>= 0.13' - type: software @@ -334,7 +334,7 @@ test <- cff_create("rmarkdown") given-names: Richard email: rich@posit.co orcid: https://orcid.org/0000-0003-3925-190X - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.fontawesome version: '>= 0.5.0' - type: software @@ -364,7 +364,7 @@ test <- cff_create("rmarkdown") email: yihui@posit.co - family-names: Allen given-names: Jeff - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.htmltools version: '>= 0.5.1' - type: software @@ -380,7 +380,7 @@ test <- cff_create("rmarkdown") - family-names: Cheng given-names: Joe email: joe@rstudio.com - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.jquerylib - type: software title: jsonlite @@ -393,7 +393,7 @@ test <- cff_create("rmarkdown") given-names: Jeroen email: jeroenooms@gmail.com orcid: https://orcid.org/0000-0002-4035-0289 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.jsonlite - type: software title: knitr @@ -406,7 +406,7 @@ test <- cff_create("rmarkdown") given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.knitr version: '>= 1.43' - type: software @@ -418,7 +418,7 @@ test <- cff_create("rmarkdown") institution: name: R Foundation for Statistical Computing address: Vienna, Austria - year: '2024' + year: '2025' - type: software title: tinytex abstract: 'tinytex: Helper Functions to Install and Maintain TeX Live, and Compile @@ -431,7 +431,7 @@ test <- cff_create("rmarkdown") given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.tinytex version: '>= 0.31' - type: software @@ -443,7 +443,7 @@ test <- cff_create("rmarkdown") institution: name: R Foundation for Statistical Computing address: Vienna, Austria - year: '2024' + year: '2025' - type: software title: utils abstract: 'R: A Language and Environment for Statistical Computing' @@ -453,7 +453,7 @@ test <- cff_create("rmarkdown") institution: name: R Foundation for Statistical Computing address: Vienna, Austria - year: '2024' + year: '2025' - type: software title: xfun abstract: 'xfun: Supporting Functions for Packages Maintained by ''Yihui Xie''' @@ -465,7 +465,7 @@ test <- cff_create("rmarkdown") given-names: Yihui email: xie@yihui.name orcid: https://orcid.org/0000-0003-0645-5666 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.xfun version: '>= 0.36' - type: software @@ -502,7 +502,7 @@ test <- cff_create("rmarkdown") given-names: Zhian N. - family-names: Gao given-names: Charlie - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.yaml version: '>= 2.1.19' - type: software @@ -516,7 +516,7 @@ test <- cff_create("rmarkdown") given-names: Dirk email: edd@debian.org orcid: https://orcid.org/0000-0001-6419-907X - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.digest - type: software title: dygraphs @@ -537,7 +537,7 @@ test <- cff_create("rmarkdown") given-names: Daniel - family-names: Thieurmel given-names: Benoit - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.dygraphs - type: software title: fs @@ -554,7 +554,7 @@ test <- cff_create("rmarkdown") - family-names: Csárdi given-names: Gábor email: csardi.gabor@gmail.com - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.fs - type: software title: rsconnect @@ -575,7 +575,7 @@ test <- cff_create("rmarkdown") given-names: Jonathan - family-names: Allaire given-names: JJ - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.rsconnect - type: software title: downlit @@ -587,7 +587,7 @@ test <- cff_create("rmarkdown") - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.downlit version: '>= 0.4.0' - type: software @@ -601,7 +601,7 @@ test <- cff_create("rmarkdown") given-names: Jeroen email: jeroenooms@gmail.com orcid: https://orcid.org/0000-0002-4035-0289 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.katex version: '>= 1.4.0' - type: software @@ -629,7 +629,7 @@ test <- cff_create("rmarkdown") given-names: Carson email: carson@rstudio.com orcid: https://orcid.org/0000-0002-4958-2844 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.sass version: '>= 0.4.0' - type: software @@ -669,7 +669,7 @@ test <- cff_create("rmarkdown") given-names: Alan - family-names: Borges given-names: Barbara - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.shiny version: '>= 1.6.0' - type: software @@ -682,7 +682,7 @@ test <- cff_create("rmarkdown") - family-names: Wickham given-names: Hadley email: hadley@posit.co - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.testthat version: '>= 3.0.3' - type: software @@ -699,7 +699,7 @@ test <- cff_create("rmarkdown") - family-names: Wickham given-names: Hadley email: hadley@rstudio.com - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.tibble - type: software title: vctrs @@ -717,7 +717,7 @@ test <- cff_create("rmarkdown") - family-names: Vaughan given-names: Davis email: davis@posit.co - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.vctrs - type: software title: cleanrmd @@ -730,7 +730,7 @@ test <- cff_create("rmarkdown") given-names: Garrick email: garrick@adenbuie.com orcid: https://orcid.org/0000-0002-7111-0077 - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.cleanrmd - type: software title: withr @@ -755,7 +755,7 @@ test <- cff_create("rmarkdown") email: hadley@posit.co - family-names: Chang given-names: Winston - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.withr version: '>= 2.4.2' - type: software @@ -772,7 +772,7 @@ test <- cff_create("rmarkdown") given-names: Jim - family-names: Ooms given-names: Jeroen - year: '2024' + year: '2025' doi: 10.32614/CRAN.package.xml2 diff --git a/cffr.Rproj b/cffr.Rproj index 78bb4b7..e171837 100644 --- a/cffr.Rproj +++ b/cffr.Rproj @@ -1,5 +1,4 @@ Version: 1.0 -ProjectId: 25881e07-70a0-49da-ab8f-b4b862c2aeed RestoreWorkspace: No SaveWorkspace: No diff --git a/codemeta.json b/codemeta.json index 3ff3caa..2ce4feb 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/ropensci/cffr", "issueTracker": "https://github.com/ropensci/cffr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "1.1.1", + "version": "1.1.1.9000", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", @@ -200,7 +200,7 @@ }, "isPartOf": "https://ropensci.org", "keywords": ["attribution", "citation", "credit", "citation-files", "cff", "metadata", "citation-file-format", "cran", "r", "r-package", "ropensci", "rstats"], - "fileSize": "1623.325KB", + "fileSize": "1626.79KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/inst/WORDLIST b/inst/WORDLIST index e508878..d5e0ca5 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -14,6 +14,7 @@ CRC Cabunoc Chue CodeMeta +DOI Decoret Druskat Easi @@ -45,6 +46,7 @@ Pérez README RSPM RStudio +Reproducibility Riederer SPDX Spaaks @@ -52,6 +54,7 @@ Suárez Waldir Wickham Willighagen +YAML Zenodo Zotero al @@ -81,6 +84,8 @@ param plaintext pre rOpenSci +repo +repos rmarkdown schemas testthat diff --git a/inst/schemaorg.json b/inst/schemaorg.json index 92f0606..c47598b 100644 --- a/inst/schemaorg.json +++ b/inst/schemaorg.json @@ -27,5 +27,5 @@ "url": "https://cran.r-project.org" }, "runtimePlatform": "R version 4.4.2 (2024-10-31 ucrt)", - "version": "1.1.1" + "version": "1.1.1.9000" } diff --git a/man/cff_write.Rd b/man/cff_write.Rd index 9f11ca0..4cb98d9 100644 --- a/man/cff_write.Rd +++ b/man/cff_write.Rd @@ -10,6 +10,7 @@ cff_write( keys = list(), cff_version = "1.2.0", gh_keywords = TRUE, + r_citation = FALSE, dependencies = TRUE, validate = TRUE, verbose = TRUE, @@ -39,6 +40,11 @@ in-development \strong{R} package. \item{gh_keywords}{Logical \code{TRUE/FALSE}. If the package is hosted on GitHub, would you like to add the repo topics as keywords?} +\item{r_citation}{Logical \code{TRUE/FALSE}. On \code{TRUE} the \strong{R} package citation +(i.e. \code{inst/CITATION}) would be created or updated. +\strong{No backup copy would be created}, for more control use +\code{\link[=cff_write_citation]{cff_write_citation()}}.} + \item{dependencies}{Logical \code{TRUE/FALSE}. Would you like to add the of your package to the \code{references} CFF key?} diff --git a/revdep/README.md b/revdep/README.md index f45a4af..b783b80 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,33 +1,32 @@ # Platform -|field |value | -|:--------|:----------------------------------------| -|version |R version 4.4.1 (2024-06-14 ucrt) | -|os |Windows 11 x64 (build 22631) | -|system |x86_64, mingw32 | -|ui |RStudio | -|language |(EN) | -|collate |Spanish_Spain.utf8 | -|ctype |Spanish_Spain.utf8 | -|tz |Europe/Madrid | -|date |2024-08-11 | -|rstudio |2024.04.2+764 Chocolate Cosmos (desktop) | -|pandoc |3.1.12.2 @ C:\PROGRA~1\Pandoc\pandoc.exe | +|field |value | +|:--------|:------------------------------------------------------| +|version |R version 4.4.2 (2024-10-31) | +|os |Ubuntu 24.04.1 LTS | +|system |x86_64, linux-gnu | +|ui |X11 | +|language |(EN) | +|collate |C.UTF-8 | +|ctype |C.UTF-8 | +|tz |UTC | +|date |2025-01-17 | +|pandoc |3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/pandoc | # Dependencies -|package |old |new |Δ | -|:------------|:------|:------|:--| -|cffr |1.1.0 |1.1.1 |* | -|cli |3.6.3 |3.6.3 | | -|curl |5.2.1 |5.2.1 | | -|desc |1.4.3 |1.4.3 | | -|jsonlite |1.8.8 |1.8.8 | | -|jsonvalidate |1.3.2 |1.3.2 | | -|R6 |2.5.1 |2.5.1 | | -|Rcpp |1.0.13 |1.0.13 | | -|V8 |4.4.2 |4.4.2 | | -|yaml |2.3.10 |2.3.10 | | +|package |old |new |Δ | +|:------------|:------|:----------|:--| +|cffr |1.1.1 |1.1.1.9000 |* | +|cli |3.6.3 |3.6.3 | | +|curl |6.1.0 |6.1.0 | | +|desc |1.4.3 |1.4.3 | | +|jsonlite |1.8.9 |1.8.9 | | +|jsonvalidate |1.3.2 |1.3.2 | | +|R6 |2.5.1 |2.5.1 | | +|Rcpp |1.0.14 |1.0.14 | | +|V8 |6.0.0 |6.0.0 | | +|yaml |2.3.10 |2.3.10 | | # Revdeps diff --git a/revdep/cran.md b/revdep/cran.md index ab1853c..bfbf120 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 4 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 5 reverse dependencies (0 from CRAN + 5 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/tests/testthat/_snaps/mock-package.md b/tests/testthat/_snaps/mock-package.md index 7b03744..67b98f9 100644 --- a/tests/testthat/_snaps/mock-package.md +++ b/tests/testthat/_snaps/mock-package.md @@ -1,5 +1,23 @@ # Test in mock package + Code + auto_cit1 + Output + Basic M (????). "manyurls: A lot of urls." + . + + A BibTeX entry for LaTeX users is + + @Misc{basic, + title = {manyurls: A lot of urls}, + author = {Marc Basic}, + url = {https://test.github.io/package/}, + abstract = {This package has many urls. Specifically, 1 Bug Reports and 6 URLs. Expected is to have 1 repository-code, 1 url and 3 URLs, since there is 1 duplicate and 1 invalid url.}, + version = {0.1.6}, + } + +--- + Code cffobj Output diff --git a/tests/testthat/test-mock-package.R b/tests/testthat/test-mock-package.R index 25c023f..63177db 100644 --- a/tests/testthat/test-mock-package.R +++ b/tests/testthat/test-mock-package.R @@ -16,6 +16,35 @@ test_that("Test in mock package", { to = "DESCRIPTION" ) + # Create a cff + expect_silent(cff_write(verbose = FALSE)) + expect_false(file.exists("inst/CITATION")) + + # Create a cff also with auto_citation + expect_silent(cff_write(verbose = FALSE, r_citation = TRUE)) + expect_true(file.exists("inst/CITATION")) + + auto_cit1 <- utils::readCitationFile("inst/CITATION", + meta = list(Encoding = "UTF-8") + ) + + # Same but with verbose + ff <- cff_write(verbose = TRUE, r_citation = TRUE) + + # No backup + + expect_length(list.files("inst"), 1) + + auto_cit2 <- utils::readCitationFile("inst/CITATION", + meta = list(Encoding = "UTF-8") + ) + + expect_identical(auto_cit1, auto_cit2) + + # Clean + unlink("inst", recursive = TRUE, force = TRUE) + expect_false(dir.exists("inst")) + # Get bibentry a_bib <- as_bibentry() # Create citation @@ -76,9 +105,15 @@ test_that("Test in mock package", { # Revert to initial wd setwd(current_dir) + unlink(new_dir, recursive = TRUE, force = TRUE) + + rvers <- getRversion() + skip_if(!grepl("^4.4", rvers), "Snapshot created with R 4.4.*") + + expect_false(identical(auto_cit1, cit)) + expect_true(identical(auto_cit1, auto_cit2)) + expect_snapshot(auto_cit1) expect_snapshot(cffobj) expect_snapshot(toBibtex(cit)) expect_snapshot(toBibtex(a_bib)) - - unlink(new_dir, recursive = TRUE, force = TRUE) })