1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-31 18:21:44 +02:00
This commit is contained in:
2026-05-01 19:05:14 +02:00
parent b6d80f9578
commit d805fece8c
4 changed files with 18 additions and 21 deletions

View File

@@ -32,4 +32,11 @@ test_that("test-_deprecated.R", {
expect_warning(example_isolates[, ab_class("mycobact")])
expect_warning(example_isolates[, ab_selector(name %like% "trim")])
# deprecated custom_interpretive_rules() still works and emits a warning
expect_warning(
x_old <- custom_eucast_rules(AMC == "R" ~ aminopenicillins == "R"),
regexp = "custom_eucast_rules"
)
expect_inherits(x_old, "custom_interpretive_rules")
})

View File

@@ -53,12 +53,12 @@ test_that("test-data.R", {
expect_false(anyNA(microorganisms.codes$mo))
expect_true(all(dosage$ab %in% AMR::antimicrobials$ab))
expect_true(all(dosage$name %in% AMR::antimicrobials$name))
eucast_abx <- AMR:::EUCAST_RULES_DF$and_these_antibiotics
eucast_abx <- unique(unlist(strsplit(eucast_abx[!is.na(eucast_abx)], ", +")))
expect_true(all(eucast_abx %in% AMR::antimicrobials$ab),
interpretive_abx <- AMR:::INTERPRETIVE_RULES_DF$and_these_antibiotics
interpretive_abx <- unique(unlist(strsplit(interpretive_abx[!is.na(interpretive_abx)], ", +")))
expect_true(all(interpretive_abx %in% AMR::antimicrobials$ab),
info = paste0(
"Missing in `antimicrobials` data set: ",
toString(eucast_abx[which(!eucast_abx %in% AMR::antimicrobials$ab)])
toString(interpretive_abx[which(!interpretive_abx %in% AMR::antimicrobials$ab)])
)
)

View File

@@ -242,13 +242,6 @@ test_that("test-interpretive_rules.R", {
tolerance = 0.5
)
# deprecated custom_interpretive_rules() still works and emits a warning
expect_warning(
x_old <- custom_interpretive_rules(AMC == "R" ~ aminopenicillins == "R"),
regexp = "custom_interpretive_rules"
)
expect_inherits(x_old, "custom_interpretive_rules")
# clsi_rules() no longer errors (returns data unchanged until CLSI rows are added)
expect_identical(
suppressWarnings(clsi_rules(example_isolates, info = FALSE)),