1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 17:41:59 +02:00

fix for as.mo and freq

This commit is contained in:
2018-11-30 12:05:59 +01:00
parent 9ddf6dc530
commit 31e977937d
7 changed files with 43 additions and 24 deletions

View File

@ -73,6 +73,10 @@ test_that("EUCAST rules work", {
, info = FALSE))$amox,
"S")
# also test norf
expect_output(suppressWarnings(eucast_rules(septic_patients %>% mutate(norf = "S", nali = "S"))))
# check verbose output
expect_output(suppressWarnings(eucast_rules(septic_patients, verbose = TRUE)))
})

View File

@ -77,6 +77,9 @@ test_that("as.mo works", {
# too few characters
expect_warning(as.mo("ab"))
expect_equal(suppressWarnings(as.character(as.mo(c("Qq species", "", "CRS", "K. pneu rhino", "esco")))),
c(NA_character_, NA_character_, "B_STNTR_MAL", "B_KLBSL_PNE_RHI", "B_ESCHR_COL"))
# check for Becker classification
expect_identical(as.character(guess_mo("S. epidermidis", Becker = FALSE)), "B_STPHY_EPI")
expect_identical(as.character(guess_mo("S. epidermidis", Becker = TRUE)), "B_STPHY_CNS")
@ -202,4 +205,9 @@ test_that("as.mo works", {
"E. species")),
rep("Escherichia species", 3))
# from different sources
expect_equal(as.character(as.mo(
c("PRTMIR", "bclcer", "B_ESCHR_COL"))),
c("B_PROTS_MIR", "B_BCLLS_CER", "B_ESCHR_COL"))
})