1
0
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:
2020-07-22 12:29:51 +02:00
parent 09fba38ea6
commit ab2b359e6b
13 changed files with 29 additions and 25 deletions

View File

@ -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,

View File

@ -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 %>%