diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index a40d4b2a..0851f7a4 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -36,9 +36,6 @@ name: R-code-check-PR jobs: R-code-check-PR: - # do not run if we are the authors - the other checks will already run - if: ${{ github.event.comment.author_association }} != 'CONTRIBUTOR' && ${{ github.event.comment.author_association }} != 'MEMBER' && ${{ github.event.comment.author_association }} != 'OWNER' && ${{ github.context.payload.comment.author_association }} != 'CONTRIBUTOR' && ${{ github.context.payload.comment.author_association }} != 'MEMBER' && ${{ github.context.payload.comment.author_association }} != 'OWNER' - runs-on: ${{ matrix.config.os }} continue-on-error: ${{ matrix.config.allowfail }} diff --git a/DESCRIPTION b/DESCRIPTION index 56e432e8..1a1dc9b2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 1.8.2.9022 +Version: 1.8.2.9023 Date: 2022-10-02 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) diff --git a/NEWS.md b/NEWS.md index d4f81ddd..35b32b55 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 1.8.2.9022 +# AMR 1.8.2.9023 This version will eventually become v2.0! We're happy to reach a new major milestone soon! diff --git a/R/aa_helper_functions.R b/R/aa_helper_functions.R index 1f7c9174..a95b890d 100755 --- a/R/aa_helper_functions.R +++ b/R/aa_helper_functions.R @@ -1459,6 +1459,13 @@ if (getRversion() < "3.3.0") { paste0(replicate(times, x), collapse = "") }, list(x = x, times = times), MoreArgs = list()), use.names = FALSE) } +} + +if (getRversion() < "3.5.0") { + isFALSE <- function(x) { + is.logical(x) && length(x) == 1L && !is.na(x) && !x + } + # trims() was introduced in 3.3.0, but its argument `whitespace` only in 3.5.0 trimws <- function(x, which = c("both", "left", "right"), whitespace = "[ \t\r\n]") { which <- match.arg(which) mysub <- function(re, x) sub(re, "", x, perl = TRUE) @@ -1470,12 +1477,6 @@ if (getRversion() < "3.3.0") { } } -if (getRversion() < "3.5.0") { - isFALSE <- function(x) { - is.logical(x) && length(x) == 1L && !is.na(x) && !x - } -} - if (getRversion() < "3.6.0") { str2lang <- function(s) { stopifnot(length(s) == 1L) diff --git a/inst/tinytest/test-mo_property.R b/inst/tinytest/test-mo_property.R index 595dc0a1..c7b87425 100644 --- a/inst/tinytest/test-mo_property.R +++ b/inst/tinytest/test-mo_property.R @@ -79,9 +79,9 @@ expect_identical(MOs$fullname, mo_fullname(MOs$fullname, language = "en")) expect_equal(mo_type("Escherichia coli", language = "de"), "Bakterien") expect_equal(mo_gramstain("Escherichia coli", language = "nl"), "Gram-negatief") -for (l in LANGUAGES_SUPPORTED) { - expect_stdout(print(mo_gramstain("Escherichia coli", language = l))) - print(mo_gramstain("Escherichia coli", language = l)) +gr <- mo_gramstain("Escherichia coli", language = NULL) +for (l in AMR:::LANGUAGES_SUPPORTED[-1]) { + expect_false(mo_gramstain("Escherichia coli", language = l) == gr, info = paste("Gram-stain in langauge", l)) } expect_error(mo_gramstain("Escherichia coli", language = "UNKNOWN")) diff --git a/tests/tinytest.R b/tests/tinytest.R index eeca7ace..3508620c 100644 --- a/tests/tinytest.R +++ b/tests/tinytest.R @@ -51,10 +51,10 @@ if (identical(Sys.getenv("R_RUN_TINYTEST"), "true")) { } if (getRversion() < "3.3.0") { strrep <- AMR:::strrep - trimws <- AMR:::trimws } if (getRversion() < "3.5.0") { isFALSE <- AMR:::isFALSE + trimws <- AMR:::trimws } if (getRversion() < "3.6.0") { str2lang <- AMR:::str2lang