1
0
mirror of https://github.com/msberends/AMR.git synced 2026-03-11 17:47:50 +01:00

(v3.0.1.9032) fix unit tests

This commit is contained in:
2026-03-08 20:36:15 +01:00
parent b6f8584994
commit cba315c2e7
4 changed files with 12 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
Package: AMR Package: AMR
Version: 3.0.1.9031 Version: 3.0.1.9032
Date: 2026-03-08 Date: 2026-03-08
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@@ -1,4 +1,4 @@
# AMR 3.0.1.9031 # AMR 3.0.1.9032
### New ### New
* Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes` * Integration with the **tidymodels** framework to allow seamless use of SIR, MIC and disk data in modelling pipelines via `recipes`

View File

@@ -506,7 +506,7 @@ mdro <- function(x = NULL,
.new_col <- paste0(.base_code, ".inferred_sir_proxy_from#", paste0(.combos, collapse = "/"), "#") .new_col <- paste0(.base_code, ".inferred_sir_proxy_from#", paste0(.combos, collapse = "/"), "#")
x[[.new_col]] <- ifelse(rowSums(.sir_chars == "R", na.rm = TRUE) > 0L, "R", NA_character_) x[[.new_col]] <- ifelse(rowSums(.sir_chars == "R", na.rm = TRUE) > 0L, "R", NA_character_)
cols_ab <- c(cols_ab, stats::setNames(.new_col, .base_code)) cols_ab <- c(cols_ab, stats::setNames(.new_col, .base_code))
if (info == TRUE) { if (isTRUE(info.bak)) {
message_( message_(
"Inferring resistance for ", "Inferring resistance for ",
ab_name(.base_code, language = NULL, tolower = TRUE), ab_name(.base_code, language = NULL, tolower = TRUE),

View File

@@ -178,9 +178,15 @@ test_that("test-zzz.R", {
also_load = FALSE, also_load = FALSE,
min_version = if (pkg == "dplyr") "1.0.0" else NULL min_version = if (pkg == "dplyr") "1.0.0" else NULL
)) { )) {
if (pkg == "rstudioapi") {
expect_true(is.function(tryCatch(get(fn, envir = asNamespace(pkg)), error = function(e) NULL)),
info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`")
)
} else {
expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)), expect_true(!is.null(AMR:::import_fn(name = fn, pkg = pkg, error_on_fail = FALSE)),
info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`") info = paste0("Function does not exist (anymore): function `", pkg, "::", fn, "()`")
) )
}
} else if (pkg != "rstudioapi") { } else if (pkg != "rstudioapi") {
warning("Package '", pkg, "' not available") warning("Package '", pkg, "' not available")
} }