mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 04:42:22 +02:00
(v1.2.0.9036) unit test fix
This commit is contained in:
@ -97,7 +97,7 @@ test_that("mo_property works", {
|
||||
expect_equal(mo_snomed("Escherichia coli"), 112283007)
|
||||
|
||||
# old codes must throw a warning in mo_* family
|
||||
expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
|
||||
expect_message(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
|
||||
|
||||
# outcome of mo_fullname must always return the fullname from the data set
|
||||
x <- data.frame(mo = microorganisms$mo,
|
||||
|
@ -37,16 +37,17 @@ test_that("rsi works", {
|
||||
expect_equal(as.character(as.rsi(c(1:3))), c("S", "I", "R"))
|
||||
|
||||
expect_equal(suppressWarnings(as.logical(as.rsi("INVALID VALUE"))), NA)
|
||||
|
||||
expect_equal(summary(as.rsi(c("S", "R"))), c("Class" = "rsi",
|
||||
"%R" = "50% (n=1)",
|
||||
"%SI" = "50% (n=1)",
|
||||
"- %S" = "50% (n=1)",
|
||||
"- %I" = "0% (n=0)"))
|
||||
|
||||
|
||||
expect_equal(summary(as.rsi(c("S", "R"))),
|
||||
structure(c("Class" = "rsi",
|
||||
"%R" = "50% (n=1)",
|
||||
"%SI" = "50% (n=1)",
|
||||
"- %S" = "50% (n=1)",
|
||||
"- %I" = "0% (n=0)"), class = c("summaryDefault", "table")))
|
||||
|
||||
expect_identical(as.logical(lapply(example_isolates, is.rsi.eligible)),
|
||||
rep(FALSE, length(example_isolates)))
|
||||
|
||||
|
||||
library(dplyr)
|
||||
# 40 rsi columns
|
||||
expect_equal(example_isolates %>%
|
||||
|
Reference in New Issue
Block a user